Knowledgebase
redirect to https, exclude one page - cloudflare
Posted by bobpit, 03-23-2015, 05:32 AM | In the htaccess I have this command:
# redirect http to https.
RewriteCond %{REQUEST_URI} !^/abc.html
RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteRule ^(.*)$ https://example.com/$1 [L]
This does redirect all pages to https, excluding the example.com/abc.html.
However I want to redirect https://example.com/abc.html to http://example.com/abc.html.
So I entered afterwards the commands:
RewriteCond %{REQUEST_URI} ^/abc.html
RewriteCond %{HTTP:CF-Visitor} '"scheme":"https"'
RewriteRule ^(.*)$ http://example.com/$1 [L]
It did not work. I can still go to https://example.com/abc.html
Any ideas how to fix this?
I am using the cloudflare free plan, with their flex-ssl.
|
Posted by Srv24x7, 03-23-2015, 10:39 AM | Hi,
Have you tried setting up a separate redirection for " https://example.com/abc.html to http://example.com/abc.html." ?
|
Posted by bobpit, 03-23-2015, 10:46 AM | I have tried this:
redirect 301 https://example.com/abc.html http://example.com/abc.html
One of the many that did not work.
|
|
Add to Favourites
Print this Article |
Also Read