2

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 Answer 1

4

Can you try NE flag:

RewriteRule ^/?linkto/(.*?)/ ${unesc:$1} [R,L,NE,NC]
Sign up to request clarification or add additional context in comments.

4 Comments

That work better... but redirect to: localhost/http://www.google.cl/#test instead of google.cl/#test
Solved using rewrite like this: RewriteRule ^/linkto/(.*?)/ ${unesc:$1} [R,L,NE,NC] Thanks !
ok perfect, glad that it worked. Please consider marking the answer as accepted to help out future visitors.
What is "${unesc:" function? is it documented?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.