Rewrite sub-domain to directory

后端 未结 2 1092
生来不讨喜
生来不讨喜 2020-12-17 05:23

I\'d like to map subdomain.example.com to www.example.com/subdomain using an internal URL rewrite that looks at the host name and simply forwards a

2条回答
  •  粉色の甜心
    2020-12-17 05:52

    Using .htaccess:

    RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com 
    RewriteRule (.*) http://www.yourdomain.com/$1 [R=301,L]
    

提交回复
热议问题