Apache RewriteRule redirection with url encoded

萝らか妹 提交于 2019-12-12 17:22:59

问题


I have this URL (urlencoded twice):

http%253A%252F%252Fwww.google.cl%252F%2523test (translated: http://www.google.cl/#test)

And this Rewrite Rule:

RewriteRule /linkto/(.*?)/ ${unesc:$1} [R,L]

If i put this url in the browser:

http://localhost/linkto/http%253A%252F%252Fwww.google.cl%252F%2523test/data/

Apache redirects to http://www.google.cl/%23test instead of http://www.google.cl/#test

The problem ocurrs only with # (number sign).

Any ideas?


回答1:


Can you try NE flag:

RewriteRule ^/?linkto/(.*?)/ ${unesc:$1} [R,L,NE,NC]


来源:https://stackoverflow.com/questions/18990593/apache-rewriterule-redirection-with-url-encoded

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!