I asked part of this question some time ago in stackoverflow, and it works fine: es
I have a multi-domain server, each directory corresponds to a domain name. However, my primary domain name www.mydomain.com is also a directory on my server and is not automatically linked.
That is why I use this in my root website ...
root /.htaccess
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/my-website/
RewriteCond %{DOCUMENT_ROOT}/my-website%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}/my-website%{REQUEST_URI} -d
RewriteRule ^(.*)$ /my-website/$1 [L]
Now, when I call www.my-website.com, it automatically starts the directory /my-website. This is just great. However, in this directory I have another .htaccess file with this in it.
root / my site / .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
RewriteRule ^/projects/(.+?\.php)$ /$1 [L,NC]
RewriteRule ^/jobs/(.+?\.php)$ /$1 [L,NC]
RewriteRule ^(/downloads/.+)/?$ assets/$1 [L,NC]
, , , /projects/, "" .
, - - main-htaccess , RewriteConditions , " "
?