Redirect from https to http.
-
Hi Sandeep, we have a client with CWP that wants to redirect a domain from https to http, in CWP it has been practically impossible for us, we fall into a redirection loop. Is there any trick to do it in CWP?
Greetings!
-
Hey @JosePP,
It's very simple, just use a config on the WebServer for the domain without HTTPS, so the webserver is open to 2 protocols (HTTP / HTTPS).
Then just add a redirect to htaccess, with code like this:
RewriteEngine On RewriteCond %{HTTPS} on RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
-
@gpl-one Hello!
I thought that was easy, until I came across this problem at CWP hahaha
I have exactly the same code that you tell me and CWP ignores it completely, look:
1: https://i.gyazo.com/d8465e868020bbe6725146a50011ac53.png
2: https://i.gyazo.com/5b03bd40df595cfcd2daa4794677f26b.png
3: Web: https://i.gyazo.com/76cda8f431f2d61038bee05191d8739b.pngI thought it was fine, besides, my code is very similar to yours, but it doesn't listen to me.
What am I doing wrong?
-
probably cache ? its better to check http headers if its redirecting to http.
-
@sandeep said in Redirig from https to http.:
check http headers
https://i.gyazo.com/0443670e403a070a98a996f065293d8b.png
According to this tool it does not seem to be caching.
I open it from tor and it does not redirect me either.
-
cache can be your browser, seems you're getting 200 status code the redirect is not working. You also need to edit your site URL settings.
-
Hey @JosePP
I checked your site and it is working as I had spoken with the 2 protocols working without redirect.
I think there must be a problem using the {HTTP_HOST} and {REQUEST_URI} variables on your server.
You can try to declare the URL directly without using apache variables, like this:
RewriteEngine On RewriteCond %{HTTPS} on RewriteRule ^(.*)$ http://inprenta.eus/$1 [L,R=301]
After inserting the code, restart the Web Server and try to access the site in an anonymous tab in your browser, I think it should work that way.
-
@gpl-one Nothing, I don't understand why he doesn't listen to me... I'm already bored with the problem. hahahaha
-
@JosePP said in Redirect from https to http.:
@gpl-one Nothing, I don't understand why he doesn't listen to me... I'm already bored with the problem. hahahaha
you've other planet issues
-
@sandeep Probably
-
@sandeep I opened this ticket today, if you want to see it. Let's see if you know why I'm going crazy hahaha ( #891343 )
-
@JosePP I've replied to your new ticket, the solution is provided there.