Created .htaccess file in /var/www to redirect to folder /var/www/foo

Posted by Serg on Server Fault See other posts from Server Fault or by Serg
Published on 2012-11-18T21:02:54Z Indexed on 2012/11/18 23:06 UTC
Read the original article Hit count: 209

Filed under:
|

Context: How can I configure a NameCheap domain to point to an Apache subfolder?


Following Devin's answer here I've created a .htaccess file in /var/www and wrote in the following:

RewriteEngine On

RewriteCond !sergiotapia.me
RewriteRule (.*) sergiotapia.me/$1 [QSA]

My folder structure is such:

/var/www/
/var/www/sergiotapia.me

When visiting the URL sergiotapia.me I see the contents of /var/www when I would like to be directly redirected to /var/www/sergiotapia.me

Any ideas?

© Server Fault or respective owner

Related posts about apache2

Related posts about .htaccess