Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirect URL with hash using .htaccess

Tags:

.htaccess

I want to redirect a URL containing a hash to another URL.

Example: example.com/#test should redirect to example.com/teste_page

Can this be done using the .htaccess file?

like image 743
Bruno Fernandes Avatar asked Nov 18 '11 15:11

Bruno Fernandes


2 Answers

Yes it can be done, just use the No Escape flag... [NE,R,L]

like image 114
Chandrachur Avatar answered Sep 28 '22 02:09

Chandrachur


No, hashes are never sent to the server, they are in-page fragment identifiers, so only used by the browser. So you're .htaccess would never have access to the hash. You'd have to do some nifty redirects to get that info to your server.

Here are some ideas that might spark something:

http://forum.modrewrite.com/viewtopic.php?t=3912

like image 22
swatkins Avatar answered Sep 28 '22 03:09

swatkins