mummana Posted February 26, 2009 Share Posted February 26, 2009 Hi, We want to redirect all page over HTTPS in the site. 1.) It works fine when we requet with http://mysite.com, it redirects to https://mysite.com/home/login.jsp. RewriteCond %{HTTP_HOST} mysite.com [NC] RewriteCond %{HTTPS} !on RewriteRule .* https://mysite.com/home/login.jsp [R=301] 2.) The issue is, when we request with https://mysite.com it not redirecting to https://mysite.com/home/login.jsp and it is hanging the request. Could you please help me here. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/147035-redirecting-entire-site-over-https/ Share on other sites More sharing options...
corbin Posted February 27, 2009 Share Posted February 27, 2009 The rewrite cond will make the rewrite rule execute only if https is not currently "on." So, you could just do something like: RewriteRule ^$ /home/login.jsp [R=301] (There is most likely a better way than doing a rewrite, but I can't think of it right now. Also, that 301 means that it's a "permanent" redirect, so if you actually plan on using / you should change that.) Quote Link to comment https://forums.phpfreaks.com/topic/147035-redirecting-entire-site-over-https/#findComment-772278 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.