【发布时间】:2019-08-14 14:36:56
【问题描述】:
我正在尝试配置 .htaccess 以强制重定向到特定子域。
假设我有一个带有许多子域的 example.com 域,所以最后我有这个域和子域:
- example.com
- www.example.com
- demo.example.com
- test.example.com
我想要的是打开链接example.com/test 或www.example.com/test,htaccess 应该强制重定向到test.example.com,而对于其他域它不应该。
所以基本上:
- example.com/test -> test.example.com(重定向)
- www.example.com/test -> test.example.com(重定向)
- demo.example.com/test -> demo.example.com/test(无重定向)
- test.example.com/test -> test.example.com/test(无重定向)
【问题讨论】:
标签: apache .htaccess redirect url-rewriting