我正在尝试在一个新域上逐页重定向来自多个旧域的页面,即:
第 1 页:http ://www.example.org/default.asp?id=1重定向到http://www.example2.org/newpage.html 第 2 页:http://www.example2.org/default。 asp?id=2重定向到http://www.example.org/contact.html
...等等。每个旧页面都会重定向到特定的新页面。
我试图在 .htaccess 中写一些东西
Redirect 301 http://www.example.org/default.asp?id=1 h-tp://www.example.org/newpage.html
Redirect 301 http://www.example2.org/default.asp?id=2 h-tp://www.example.org/contact.html
但到目前为止还没有运气。mod_alias 已启用...
我也尝试过像这样使用 RewriteCond 和 RewriteRule:
RewriteCond %{HTTP_HOST} example.org
RewriteRule default.asp?id=1 http://www.example.org/newpage.html [NC,L,R=301]
...
换句话说:我想进行从基于 id 到基于别名的逐页重定向,同时将三个站点/域合并到一个站点中。
我希望有一个有用的解决方案。提前致谢!