Mobile app version of vmapp.org
Login or Join
Voss4911412

: .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).

@Voss4911412

Posted in: #Htaccess #Redirects #Subdomain #Url

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Voss4911412

1 Comments

Sorted by latest first Latest Oldest Best

 

@Holmes151

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

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme