301's going from https to a http

Am trying to setup a 301 so that anyone going to a https website will go to a http website instead. Have tried the below, but doesn’t work. How would you do it please?

RewriteCond %{HTTPS} on
RewriteRule ^$ http://%{HTTP_HOST} [L,R]

You could try it like here:-

Apologies Sam, I’m lost on that thread. :frowning: The OP doesn’t seem to be wanting what I’m wanting. How would you do this please? I’ve also tried the below, but that doesn’t work either? Any help appreciated.

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

That looks very similar to what I suggested in the other topic.
But should it be:-

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Note the “s” added.

It’s going from HTTPS to HTTP.

Sorry, I was thinking the other way around.

No problem Sam. In fact, to be totally clear, trying to 301 from anything https to www.website.com without any http’s or https’s anywhere.

The helps always appreciated.

Dez.

Any help?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.