开发者

Create an Alias using Apache's mod_rewrite

I need to create an alias for one exac开发者_Python百科t page which unfortunately special characters in it. I do have an environment set up so other redirects work fine, but not this one:

RewriteRule ^/ow/email.htm?who=Kate%20Jones&direct=True&directemail=kate.jones@google.com$    http://www.google.com/ow/lalala.htm

How should I rewrite this statement so that it works?

PS. This is my first time here so do let me know if I'm not following stackoverflow policy correctly or smth ;) Thank you so much!


You need to use the RewriteCond directive for the URI query, either to examine QUERY_STRING:

RewriteCond %{QUERY_STRING} =who=Kate%20Jones&direct=True&directemail=kate.jones@google.com
RewriteRule ^/ow/email\.htm$ http://www.google.com/ow/lalala.htm

Or the request line in THE_REQUEST:

RewriteCond %{THE_REQUEST} ^GET\ /ow/email\.htm\?who=Kate%20Jones&direct=True&directemail=kate\.jones@google.com\s
RewriteRule ^/ow/email\.htm$ http://www.google.com/ow/lalala.htm
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜