开发者

What is wrong with this apache url htaccess rewrite rule?

I've got this:

RewriteEngine On
RewriteRule ^/redir?url=(.*)$ http://blah.$1

开发者_JAVA技巧When I use this and go to the url that looks like:

http://www.mydomain.com/redir?url=www.otherdomain.com

It says the file isn't found on my server. I.E. no redirect.

What I want it to do in the above example would be to redirect to:

http://blah.www.otherdomain.com


Rewriterules don't work on querystrings, RewriteCond's do:

RewriteCond %{QUERY_STRING} url=([^&]+)(&|$)
RewriteRule ^/?redir$ http://blah.%1
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜