Redirect subdomain into top-level domain's folder

后端 未结 2 1741
轻奢々
轻奢々 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: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]
    

提交回复
热议问题