: .htaccess redirect url to a subfolder on a subdomain with exceptions I have a CMS installed on a subdomain (say blog.domain.com). I created a site on it but the site can be accessed at (blog.domain.com/sites/mysite).
I have a CMS installed on a subdomain (say blog.domain.com). I created a site on it but the site can be accessed at (blog.domain.com/sites/mysite). I also have to use other links like blog.domain.com/#/create and blog.domain.com/#/login/mysite
How do I achieve the following things:
Redirect all requests to blog.domain.com to blog.domain.com/sites/mysite WITHOUT changing the URL.
Still have access to blog.domain.com/#/create and blog.domain.com/#/login/mysite
I know there are a lot of answers on .htaccess redirects but I cant find the complete answer for both my questions above.
More posts by @Voss4911412
1 Comments
Sorted by latest first Latest Oldest Best
In your subdomains document root, try the following:
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/sites/mysite/
RewriteRule (.*) sites/mysite/ [L]
Since this is an internal rewrite, you don't need to do anything with regards to #2
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.