Link to home
Start Free TrialLog in
Avatar of the-miz
the-miz

asked on

Forcing Apache to use HTTPS

I have tried several attempts at forcing my RHEL 5 web server running PHP 5.3 and Apache 2.2.3 to always use HTTPS instead of HTTP.   I want wherever anyone goes or whatever anyone types into the address bar of the web browser to automatically use https://

I have tried the following without success:

RewriteCond %{HTTPS} off

RewriteCond %{HTTPS} !=on

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]

RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Need help!
ASKER CERTIFIED SOLUTION
Avatar of boon86
boon86
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of the-miz
the-miz

ASKER

Beautiful.  Worked!  Thanks a million