我想将基本网址重定向到外部网站.
例如,我想example.com重定向到anotherdomain.com但我不想example.com/path被重定向.
到目前为止,example.com/path重定向到anotherdomain.com/path.:(
编辑:
首先,谢谢你的帮助!example.com现在重定向到another.com而不影响example.com的子路径.
但是,理想情况下,m.example.com不会重定向到another.com.所以它真的只是example.com重定向到another.com.
将此添加到您.htaccess的DocumentRoot.我假设您在服务器上只托管一个域.
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^m\.
RewriteRule ^$ http://anotherdomain.com [R,L]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
13492 次 |
| 最近记录: |