dartsuresh Posted September 25, 2012 Share Posted September 25, 2012 Hi, i need a help.already we have mode rewrite rule RewriteRule ^(.*).html$ index.php?set=$1 this rule change html url to php now in this i need to add a condition https redirect how with this existing condition can i add new feature. I tried to changed htaccess file but after my change my site not working properly. My old htaccess working correctly new one not working. my project is zend frame work plzz help Old one RewriteEngine On RewriteRule ^(.*).html$ index.php?set=$1 New One RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteRule ^(.*).html$ index.php?set=$1 Quote Link to comment https://forums.phpfreaks.com/topic/268783-http-to-https-redirect/ Share on other sites More sharing options...
Adam Posted September 25, 2012 Share Posted September 25, 2012 Try: RewriteCond %{HTTPS} off I don't believe an operator is valid in there (may be wrong though). If not, temporarily enable the rewrite log and check what error you're getting. Quote Link to comment https://forums.phpfreaks.com/topic/268783-http-to-https-redirect/#findComment-1380857 Share on other sites More sharing options...
dartsuresh Posted September 25, 2012 Author Share Posted September 25, 2012 this method working but my old rewrite rule not working properly. My old method browser url has html extention then that rewrite to php plz review my old and new htaccess Quote Link to comment https://forums.phpfreaks.com/topic/268783-http-to-https-redirect/#findComment-1380862 Share on other sites More sharing options...
scootstah Posted September 25, 2012 Share Posted September 25, 2012 You have the "L" flag in the HTTPS rewrite, which means "Last". Any subsequent RewriteRule's will be ignored. Quote Link to comment https://forums.phpfreaks.com/topic/268783-http-to-https-redirect/#findComment-1380863 Share on other sites More sharing options...
dartsuresh Posted September 25, 2012 Author Share Posted September 25, 2012 No just i need only 2 rules 1)Http to https 2)^(.*).html$ index.php?set=$1 when i use this https redirect my old rule not working My old what it doing is all links in my site with html extention only after the page request change that html to php extention see in my 2 point when i use RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] rule not working. When am in login page page redirect https properly am happy then i try to login the page comes again the same page its not proceed futher process. We are using MVCpatten index.php page handle the request and get the page with help of controller and templates . Am struggle how can i proceed further. Quote Link to comment https://forums.phpfreaks.com/topic/268783-http-to-https-redirect/#findComment-1380871 Share on other sites More sharing options...
scootstah Posted September 25, 2012 Share Posted September 25, 2012 [L,R=301] See the L? That is a flag saying that this is the last RewriteRule that is going to happen, so ignore any other rules below it. You need to either take that out, or move your other rule up. Quote Link to comment https://forums.phpfreaks.com/topic/268783-http-to-https-redirect/#findComment-1380906 Share on other sites More sharing options...
dartsuresh Posted September 25, 2012 Author Share Posted September 25, 2012 thankx, now am removed L from that now also its not working. RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301] RewriteRule ^(.*).html$ index.php?set=$1 please advice Quote Link to comment https://forums.phpfreaks.com/topic/268783-http-to-https-redirect/#findComment-1380930 Share on other sites More sharing options...
dartsuresh Posted September 26, 2012 Author Share Posted September 26, 2012 any body plzz help me to out this issue plzz Quote Link to comment https://forums.phpfreaks.com/topic/268783-http-to-https-redirect/#findComment-1381045 Share on other sites More sharing options...
Adam Posted September 26, 2012 Share Posted September 26, 2012 Have you enabled and checked the rewrite log? It's very useful to figure out what's going wrong. Quote Link to comment https://forums.phpfreaks.com/topic/268783-http-to-https-redirect/#findComment-1381052 Share on other sites More sharing options...
dartsuresh Posted September 27, 2012 Author Share Posted September 27, 2012 Am checking how can enable rewrite log, I tried this one RewriteLog "/var/www/server/example.com/rewrite.log" RewriteLogLevel 5 but not loggiing Quote Link to comment https://forums.phpfreaks.com/topic/268783-http-to-https-redirect/#findComment-1381358 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.