vendredi 4 août 2017

HTACCESS redirect to folder based on hostname

I have multiple websites under the same web server.

My root structure is as following:

./

./site1/

./site2/

./.htaccess

I would like htaccess file to redirect to the correct folder.

If the user navigates to www.site1.com or site1.com it should rewrite the url to go to the ./site1/ folder and if the user navigates to www.site2.com or site2.com it should rewrite the url to go to the ./site2/ folder.

Is there any way to achieve this behaviour?

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire