0

To redirect a specific domain name to a folder in my public dir, www/, I edited .htaccess to the following:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)?domain.com$
RewriteRule ^(/)?$ domain.com/$1 [L]

Pointing my browser to http://domain.com gives me the following error:

Not Found

The requested URL /[...]/htdocs/www/domain.com/ was not found on this server.

However in my shell I can see this:

$ ls -al /[...]/htdocs/www/domain.com/
total 4
drwxr-xr-x+ 2 user group 3 2012-11-30 12:04 .
drwxr-xr-x+ 8 user group 9 2012-11-30 12:03 ..
-rw-r--r--+ 1 user group 4 2012-11-30 12:04 index.php

Editing .htaccess to point directly to index.php gives the result. An empty .htaccess file points correctly to the root directory.

What am I missing?

jorijnsmit
  • 111
  • 4

1 Answers1

0

Via this link I found the proper rules:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/subdirectory/
RewriteCond %{HTTP_HOST} ^(www\.)?name\.
RewriteRule ^(.*)$ subdirectory/$1 [L]

Please see the link itself for a full explanation on proper usage.

jorijnsmit
  • 111
  • 4