从.htacces文件中,如何将完整的URL作为GET变量传递/重定向到另一个URL?
比如:
http://www.test.com/foo/bar.asp将重定向到:
http://www.newsite.com/?url=http://www.test.com/foo/bar.asp使用完整的Url和域。
我试过:
RewriteEngine on
RedirectMatch 301 ^/(.*)\.asp http://www.newsite.com/?url=%{REQUEST_URI}但它正在消失,就像:
http://www.newsite.com/?url=?%{REQUEST_URI}发布于 2012-09-01 04:52:49
RewriteEngine on
RedirectMatch 301 ^/(.*)\.asp http://www.newsite.com/?url=$1.asp发布于 2012-09-01 05:11:22
如果初始域和协议始终相同,则可以使用
RedirectMatch 301 ^/(.*)\.asp http://www.newsite.com/?url=http%3A%2F%2Fwww.test.com%2F$1\.asphttps://stackoverflow.com/questions/12224953
复制相似问题