Answer the question
In order to leave comments, you need to log in
How to configure htaccess to work with multiple sites?
There is hosting where it is impossible to change the physical address on the server for the main domain (/home/troykaby/public_html). And there are several laravel projects that need to be placed on this hosting. I was able to set up just one project by adding the following to .htaccess, which is located at the root of public_html:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
# сайт troyka.by
RewriteCond %{HTTP_HOST} ^troyka.by$ [NC]
RewriteCond %{REQUEST_URI} !^troykaby/public
RewriteRule ^(.*)$ troykaby/public/$1 [L]
# сайт www.troyka.by
RewriteCond %{HTTP_HOST} ^www.troyka.by$ [NC]
RewriteCond %{REQUEST_URI} !^troykaby/public
RewriteRule ^(.*)$ troykaby/public/$1 [L]
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question