Forum Moderators: phranque
I have a page with several anchor links...
<a href="#fruit-apple"... blah
<a href="#fruit-banana"... blah Obviously, the hash is appended to my query string along with the anchor. But, I want this to work without having the hash in the URL. Is there a way I can do a redirect with mod_rewrite?
I've tried
RewriteRule resources/(.*) /resources/#$1 [L]
and even
RewriteRule ^food/fruit-apple$ /food/#apple [R=301,L]
Any ideas?
Fragment IDs are resolved internally by the browser and not by the server.
If you want to see stuff in the query string you will need to test %{QUERY_STRING} in your rules, as that is not a part of the path directly seen by Mod_Rewrite, but something added to the end of the path.