.htaccess重写问题

时间:2013-02-06 18:58:48

标签: .htaccess

我需要将动态网址重定向到另一个网址,动态部分保持不变,例如:

http://www.mydomain.com/VARHome.aspx?var=32

需要重定向到:

收件人:http://www.otherdomain.com/VARHome.aspx?var=32

“var =”之后的值是动态的,它可以是任何数字。

这需要通过.htaccess完成。

感谢您的帮助!

2 个答案:

答案 0 :(得分:0)

我在想RewriteRule ^(.*)$ http://www.otherdomain.com/$1 [R=301,L]或者其他方面应该做的事情。

编辑:可能类似

RewriteRule ^VARHome.aspx?var=(.*)?$ http://www.otherdomain.org/VARHome.aspx?var=$1/ [R=301,L]

答案 1 :(得分:0)

如果您在mydomain.com,请写入.htaccess

上的RewriteEngine

RedirectMatch 301 ^ / VARHome.aspx?var =(。*)$ http://www.otherdomain.com/VARHome.aspx?var= $ 1