Apache 301不同域的两个文件夹之间的重定向
我正在合并两个独立的网站,因为其中一个很快就会关闭 现在,domainA.es和domainB.es指向相同的服务器、内容和htaccess。 我想将旧URL模拟为新URL,例如:Apache 301不同域的两个文件夹之间的重定向,apache,.htaccess,redirect,mod-rewrite,url-rewriting,Apache,.htaccess,Redirect,Mod Rewrite,Url Rewriting,我正在合并两个独立的网站,因为其中一个很快就会关闭 现在,domainA.es和domainB.es指向相同的服务器、内容和htaccess。 我想将旧URL模拟为新URL,例如: 如果你加入 domainB.es/foo.asp您将被重定向到domainA.es/bar/ 试试这个 RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?domainB\.es$ RewriteRule ^foo$ http://domainA.es/bar
- 如果你加入 domainB.es/foo.asp您将被重定向到domainA.es/bar/
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domainB\.es$
RewriteRule ^foo$ http://domainA.es/bar [L,R,NC]
这将重定向到非常有效,我可以从这个示例中研究sintax。非常感谢你。
Redirect 301 /foo.asp domainA.es/bar
domainA.es/bar/foo.asp
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?domainB\.es$
RewriteRule ^foo$ http://domainA.es/bar [L,R,NC]