1

the following htaccess redirected subdomains to subfolders with same names

subdomain mooga redirected to folder mooga and we have subfolder blog in mooga

RewriteCond %{HTTP_HOST} ^((?!www\.)[^.]+)\.example\.com$
RewriteCond %1::%{REQUEST_URI} !^(.*?)::/\1/?
RewriteRule ^(.*)$ /%1/$1 [L,QSA]

https://mooga.example.com/blog/ work good

https://mooga.example.com/blog will redirected to https://mooga.example.com/mooga/blog/

I want /blog/ and /blog works as same and not redirected to /mooga/blog/

1
  • Most likely, DirectorySlash is interfering. If you want to turn it off, pay attention to the security warning though. Commented Sep 2 at 6:46

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.