Link to home
Start Free TrialLog in
Avatar of lexo
lexo

asked on

How to use htaccess to force https on the homepage only

I want to force https:// on the index page only of a site.
Right now, I am using htaccess to append www to the url:

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.mysite.com$
RewriteRule ^(.*)$ http://www.mysite.com/$1 [R=301]

How do I force ssl to only the index page? There is a login box on this page and I need it to be secure, but the rest of the pages, I dont want to force ssl (I will control the rest through navigation).
ASKER CERTIFIED SOLUTION
Avatar of ravenpl
ravenpl
Flag of Poland 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