htaccess redirect from subdomain to root
I'm hosting several domains on one account, and I currently have a RewriteRule set to redirect the root url (www.root.com) to a subdirectory (/public_html/root/).
However, I have few directories in the root (/public_html/xyz/) that I would like to access from the root url (www.root.com/xyz). Is this possible to write a redirect for this, or do I have to place these folder in the /public_html/root/ directory?
This is what I have for the .htaccess
RewriteEngine on
开发者_Python百科RewriteCond %{HTTP_HOST} ^(www.)?root.com$
RewriteCond %{REQUEST_URI} !^/root/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^(www.)?root.com$
RewriteRule ^(/)?$ root/index.php [L]
Thanks in advance!
This sounds like job for a simple Alias.
Try this in your domain's VirtualHost
:
Alias /xyz/ /public_html/xyz/
精彩评论