【发布时间】:2011-12-29 16:38:07
【问题描述】:
我有一个网站,如果我访问 URL http://mysite.com/community,它会显示找不到页面。但是,URL http://mysite.com/community/ 正确显示了页面。如何在社区之后为那个“/”设置重写?
这是我现在的 .htaccess:
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteRule ^admin$ Admin/index.php?qstr=$1 [L]
RewriteRule ^(.*)/$ index.php?qstr=$1 [L]
这些是我尝试过的,但失败了
首先,
RewriteRule ^(.*)/community $1/community/ [L]
秒,
RewriteRule /community /community/ [L]
所有有[L]的不同组合。
【问题讨论】:
-
使用最后一个,但没有前导
/ -
/community 应该去 index.php?qstr=community?
-
看来我需要把它拼出来。所以
RewriteRule community /community/ [L]
标签: .htaccess