Is there an htaccess rewrite I can deploy which will make http://example.com/about
display the same location on the page as http://example.com/#about
? If not, can I do it with jQuery?
Asked
Active
Viewed 955 times
0

Michael Berkowski
- 267,341
- 46
- 444
- 390

Amja
- 1,315
- 9
- 25
-
Check [http://stackoverflow.com/questions/2872490/how-to-use-htaccess-to-rewrite-url-to-html-anchor-tag](http://stackoverflow.com/questions/2872490/how-to-use-htaccess-to-rewrite-url-to-html-anchor-tag) and [http://stackoverflow.com/questions/2285193/htaccess-redirect-to-page-with-anchor-link](http://stackoverflow.com/questions/2285193/htaccess-redirect-to-page-with-anchor-link) – Ludovic Guillaume Feb 23 '13 at 17:16
1 Answers
0
Here, I figured it out. It's not perfect (it redirects to the anchor so you see it in the url) but it works for me:
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_]+)$ /\#$1 [R,NE]
If you were using this, http://example.com/about
would become http://example.com/#about
.

Amja
- 1,315
- 9
- 25