How to set document root to be a subdirectory using .htaccess and not VHost
snippet in htaccess

How to set document root to be a subdirectory using .htaccess and not VHost

user3714

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

RewriteCond %{DOCUMENT_ROOT}/website_1/$1 -f [OR]
RewriteCond %{DOCUMENT_ROOT}/website_1/$1 -d [OR]
RewriteCond %{DOCUMENT_ROOT}/website_1/$1 -l
RewriteRule (?!^website_1/)^(.*)$ /website_1/$1 [R=302,L,NC]

How to set document root to be a subdirectory using .htaccess and not VHost

user3184

RewriteEngine on

RewriteCond %{HTTP_HOST} ^abc.com$ [NC,OR]

RewriteCond %{HTTP_HOST} ^www.abc.com$ 

RewriteCond %{REQUEST_URI} !subdirectory/

RewriteRule (.*) /subdirectory/$1 [L]