开发者

What is wrong with this apache url htaccess rewrite rule?

开发者 https://www.devze.com 2023-01-20 17:24 出处:网络
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:

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

精彩评论

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