tags:

views:

146

answers:

1

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
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!

A: 

This sounds like job for a simple Alias.

Try this in your domain's VirtualHost:

Alias /xyz/ /public_html/xyz/
Pekka
If I add that to my htaccess file, it returns a 500 internal server error. o you have any suggestions to fix that?
Erin
@Erin what does the error log say?
Pekka
@Erin What exactly does your alias line look like?
Pekka
[Fri Apr 23 14:27:43 2010] [error] [client XX.XXX.XXX.XXX] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace. [Fri Apr 23 14:27:43 2010] [error] [client XX.XX.XXX.XX] Failed loading /home/menstrua/ioncube/ioncube_loader_lin.so: /home/menstrua/ioncube/ioncube_loader_lin.so: cannot open shared object file: No such file or directory
Erin
Alias /mail/ /public_html/mail/
Erin
@Erin What is the virtualHost's root directory (= the web root)?
Pekka
@Pekka I'm not entirely sure what you're asking for. "/home1/username/public_html/main"? If it makes any difference, the 500 error appears when I try to access the subdirectory and the user folder.
Erin
@Erin strange, don't know where that could come from.
Pekka
@Erin can you show the exact URL you are calling when this error happens?
Pekka
@Pekka it's any url beginning with http:// www. root.com
Erin