juriaan79 Posted January 4, 2010 Share Posted January 4, 2010 I'm new to this kind of modrewriting and currently trying to redirect the following url to https: So http://www.mysite.com/login should be redirected to https://www.mysite.com/login I've seen multiple examples on the web to redirect an entire domain or folder to https, but I just want to redirect single URLS I've tried the following rewriting rule: RewriteRule ^login$ https://mysite.com/login [R] But this causes a loop, I guess because every time "login" turns up in the URL Apache is redirecting. How can I prevent this? Quote Link to comment https://forums.phpfreaks.com/topic/187097-redirect-to-https-loops/ Share on other sites More sharing options...
gizmola Posted January 4, 2010 Share Posted January 4, 2010 Did you look into rewrite conditions? You can specify that, for example you are on port 80 for the rule to go into effect. RewriteCond %{SERVER_PORT} 80 Quote Link to comment https://forums.phpfreaks.com/topic/187097-redirect-to-https-loops/#findComment-988045 Share on other sites More sharing options...
juriaan79 Posted January 4, 2010 Author Share Posted January 4, 2010 Great, that works, thanks for the suggestion! Quote Link to comment https://forums.phpfreaks.com/topic/187097-redirect-to-https-loops/#findComment-988047 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.