Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有我可以部署的 htaccess 重写,它将http://example.com/about在页面上显示相同的位置http://example.com/#about?如果没有,我可以用 jQuery 来做吗?
http://example.com/about
http://example.com/#about
在这里,我想通了。它并不完美(它重定向到锚点,因此您可以在 url 中看到它)但它对我有用:
RewriteEngine On RewriteRule ^([a-zA-Z0-9_]+)$ /\#$1 [R,NE]
如果你使用这个,http://example.com/about会变成http://example.com/#about.