问题
I'm trying to redirect all the https url to http. As my new server doesn't have ssl enabled.
So Far I tried following but none of them worked.'
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301]
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
回答1:
Try :
RewriteCond %{HTTPS} =on
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
来源:https://stackoverflow.com/questions/12226795/https-to-http-301-redirect-via-htaccess