2

Some versions of Chrome automatically add https to my site addres. So I need to redirect https to http, because I don't have SSL certificate. I'm trying this, with no result:

<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine On
    RewriteCond %{HTTP:X-Forwarded-Proto} =https
    RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]  
</IfModule>
1
  • "Some versions of Chrome automatically add https to my site addres." - possibly because HSTS was implemented on your domain (at some point).
    – MrWhite
    Nov 4, 2017 at 13:29

2 Answers 2

2

Without having a certificate a browser can't speak HTTPS to your server and your server never has a chance to reply 301 to the browser.

In short, without a HTTPS server correctly configured including the certificate you can't do that.

0

to redirect https trafic to http using .htaccess you can do

RewriteEngine On
RewriteCond %{HTTPS} =on
RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

or

RewriteEngine On
RewriteCond %{SERVER_PORT} ^443$
RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

but if google redirect trafic to https, it will make a redirect loop, so you may have to find why trafic is redirected to https (maybe cache, try another browser clean from any request)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .