Difference between revisions of "Recirecting according to hostname"

From MyWiki
Jump to: navigation, search
(Created page with "https://stackoverflow.com/questions/10232722/htaccess-rewrite-based-on-hostname-or-domain-name?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa<br> <so...")
(No difference)

Revision as of 16:13, 13 June 2018

https://stackoverflow.com/questions/10232722/htaccess-rewrite-based-on-hostname-or-domain-name?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

RewriteCond %{HTTP_HOST} ^www\.site1\.com [NC] 
RewriteRule ^(.*)$ index.php?lang=it [NC,QSA] 
RewriteCond %{HTTP_HOST} ^www\.site2\.com [NC] 
RewriteRule ^(.*)$ index.php?lang=en [NC,QSA]