0
是否有一个htaccess重写我可以部署这将使http://example.com/about
在页面上显示相同的位置http://example.com/#about
?如果不是,我可以用jQuery来做到吗?.htaccess重写链接作为锚链接
是否有一个htaccess重写我可以部署这将使http://example.com/about
在页面上显示相同的位置http://example.com/#about
?如果不是,我可以用jQuery来做到吗?.htaccess重写链接作为锚链接
在这里,我明白了。它并不完美(它重定向到锚,所以你在URL中看到它),但它为我工作:
RewriteEngine On
RewriteRule ^([a-zA-Z0-9_]+)$ /\#$1 [R,NE]
如果你用这个,http://example.com/about
将成为http://example.com/#about
。
检查[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)和[http://stackoverflow.com/questions/2285193/htaccess-redirect-to-page-with-anchor-链接](http://stackoverflow.com/questions/2285193/htaccess-redirect-to-page-with-anchor-link) – 2013-02-23 17:16:47