Redirect subdomain into top-level domain's folder

后端 未结 2 1728
轻奢々
轻奢々 2020-12-05 08:27

Here\'s what I\'m trying to do.

When you type m.example.com I want users to be redirected to example.com/m/ but I would like the ur

相关标签:
2条回答
  • 2020-12-05 09:15

    Just set the subdomain's root dir to example.com/m/. Then there is no redirection.

    0 讨论(0)
  • 2020-12-05 09:17

    You can do that with mod_rewrite and mod_proxy:

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^m\.example\.com$
    RewriteRule ^ http://example.com/m%{REQUEST_URI} [L,P]
    
    0 讨论(0)
提交回复
热议问题