Mike Neir's Page[ignignokt][err]
Mike loves the feeling when he listens to a song he's heard a hundred times before and hears something new. (706 days ago)
Redirect HTTP to HTTPS

Sunday, March 13 2005, 8:56 PM

Since I don't post enough of these little tips and tricks (and because I looked for this one for like an hour last night on some customer's site I had done this for), I'm going to start posting more nifty tips. This is a mod_rewrite rule for Apache that will take any request on normal http and redirect it to the corresponding https page. Pretty handy for stuff like online shopping carts.

RewriteEngine on
RewriteCond %{SERVER_PORT} !443 [NC]
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]

Tags:


Comments

No comments entered.


Add a comment


Related Reading - apache  tips  


RSS Feed | Comments RSS Feed | Valid HTML 4.01 | Valid CSS
Memcache: Hits: 19 Misses: 0 Updates: 0 Deletes: 0 LocalHits: 0 Time: 0.0055
MySQL: Selects: 2 Inserts: 0 Updates: 0 Deletes: 0 Time: 0.0004
Page Render Time: 0.1591 seconds