Mike Neir's Page[ignignokt][err]
Mike thinks that five-day work weeks are for the birds. (1 day 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: 16 Misses: 3 Updates: 3 Deletes: 0 LocalHits: 0 Time: 0.0061
MySQL: Selects: 8 Inserts: 4 Updates: 0 Deletes: 0 Time: 2.4599
Page Render Time: 2.6216 seconds