I have found several Q/As on how to redirect root only, how to redirect from https
to http
(using .htaccess
). But there was no question that merged both. And this answer is too dirty: https://stackoverflow.com/questions/17952418/force-web-root-to-use-http. So I came up with an answer like the following:
RewriteEngine on
RewriteCond %{HTTP_HOST} provectium\.com [NC]
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Is this valid? I want it so that any query to https://provectium.com/file.html will be redirected to http://provectium.com/file.html, but not the subfolders (they should remain https://provectium.com/directory/). Thank you.
P.S. I read somewhere that the second line could be RewriteCond %{HTTP_HOST} ^provectium\.com [NC]
, what's the role of the extra ^
?