redirect all urls from http to https except one url
-
Hello! I have in my htaccess the following code to redirect all http urls to https:
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]This works great, but now I need to allow to access by http only to one specific url: /feed/products/
So I edited the code to this
RewriteCond %{HTTPS} !on
RewriteCond %{REQUEST_URI} !^/feed/products/
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]The problem is what when I enter https://mydomain.com/feed/products/ instead of keep in https://mydomain.com/feed/products/ that is what I expected, it redirects to the home page.
What is the problem? I don′t know much about htacces. Thank you!!!
- The topic ‘redirect all urls from http to https except one url’ is closed to new replies.