php - Symfony redirect based on tld -
i have multiple domainnames linked same application. redirect main tdl nl. therefore use following config , works fine:
company_core: resource: "@corebundle/controller/" type: annotation prefix: / host: www.mydomainname.{tld} defaults: tld: nl requirements: tld: "nl|eu"
would possible when user opens domain www.mydomainname.eu redirected www.mydomainname.nl/eu instead-off www.mydomainname.nl ?
it's better use apache (or nginx) kind of task:
<ifmodule mod_rewrite.c> rewriteengine on # redirect cannonical domain rewritecond %{http_host} ^www\.mydomainname\.eu [nc] rewriterule (.*) http://www.mydomainname.nl/eu/$1 [r=301,ne,l] </ifmodule>
Comments
Post a Comment