【发布时间】:2014-12-29 13:00:03
【问题描述】:
这就是我想要实现的目标。
用户点击一个链接或在地址栏中输入类似http://test.com/projects/a-project的内容
页面被重定向到http://test.com/projects/#a-project
projects子目录下存在多个项目。
到目前为止,这是我的 htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule /?projects/(.*)$ /projects/#$1 [L,R,NE]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
在http://htaccess.madewithlove.be/ 上测试时效果很好,但在我的网站上会导致重定向循环。
有什么想法吗?
【问题讨论】: