在我的sites-available
目录中,对于我的一个网站example1.com,我有这样的设置:
RewriteEngine On
RewriteRule /(.*)$ http://www.example2.com/$1 [R=301]
这使得所有去往example1.com的流量都被重定向到example2.com。
但是,我想对其进行设置,以便到example1.com的所有流量都转到example2.com上的特定页面,例如example2.com/thisPage
。
我试过了,但不起作用:
RewriteRule /(.*)$ http://www.example2.com/thisPage [R=301]
如何使用Apache配置设置从域重定向到另一个域上的特定页面?
发布于 2015-08-13 23:11:18
你没有描述你的尝试做了什么。你开着RewriteEngine吗?你把它放在正确的虚拟主机上了吗?还有其他规则吗?
你可以直接使用:
RedirectMatch .* http://www.example2.com/thisPage
https://stackoverflow.com/questions/31985723
复制相似问题