I'm trying to issue a redirect where the destination contains a fragment-identifier part. I tried with this rule:
RewriteRule ^/foo/bar/([^/]+)/(.*)$ /cgi/script#foobar::$1.$2 [R,L]
However the #
is converted into %23
and the web application cannot correctly parse this url. How can I force apache to keep the #
character ?
Solution found: there is an option for not escaping urls with mod_rewrite
:
Adding the [NE] flag solved the problem:
RewriteRule ^/foo/bar/([^/]+)/(.*)$ /cgi/script#foobar::$1.$2 [R,L,NE]