【发布时间】:2014-04-06 17:21:51
【问题描述】:
我想以以下格式访问我的页面:mysite.com/parameter 而不是 mysite.com/index.php?param=parameter。我玩弄了 httpd.conf 文件,我管理的最好的是 mysite.com/dir/parameter。
我的配置如下:
Options Indexes MultiViews Includes ExecCGI
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
RewriteEngine On
RewriteRule /(.*)$ index.php?hash=$1 [NC]
如何摆脱过多的目录?
改为:
RewriteEngine On
RewriteRule ^(.*) index.php?hash=$1 [NC]
尝试打开页面时出现以下错误
禁止
您无权访问此服务器上的 /Šw^Æ∼i。
【问题讨论】:
-
该配置是在
.htaccess样式文件中(正如问题标签所暗示的那样)还是在服务器配置中?