Hi all,
I am trying to redirect a whole domain except 1 directory - this is the code i have:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_URI} !/.well-known/
RewriteRule (.*) http://www.test.com/$1 [R=301,L]
I am making sure that always we use WWW and HTTPS
Then checking the directory not to redirect and then everything else to redirect.
Anyone got any ideas ?
I am trying to redirect a whole domain except 1 directory - this is the code i have:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{HTTPS} off
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
RewriteCond %{REQUEST_URI} !/.well-known/
RewriteRule (.*) http://www.test.com/$1 [R=301,L]
I am making sure that always we use WWW and HTTPS
Then checking the directory not to redirect and then everything else to redirect.
Anyone got any ideas ?