.htaccess main domain to subdirectory redirect not working

I have the following on .htaccess

RewriteCond %{HTTP_HOST} ^(www.)?stefanomonteiro.com$
RewriteCond %{REQUEST_URI} !^/stefanomonteiro/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /stefanomonteiro/$1
RewriteCond %{HTTP_HOST} ^(www.)?stefanomonteiro.com$
RewriteRule ^(/)?$ stefanomonteiro/index.html [L]

But stefanomonteiro.com still goes to the subdirectory /stefanomonteiro



Read more here: https://stackoverflow.com/questions/64900661/htaccess-main-domain-to-subdirectory-redirect-not-working

Content Attribution

This content was originally published by stemon at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: