【发布时间】:2011-12-12 22:07:50
【问题描述】:
我的 htaccess 页面中有以下内容:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*?)$
index.php?page=$1
</IfModule>
但这不起作用并给我内部错误 (500)。
但如果我注释掉最后两行,页面加载正常而不是错误,但无法达到我想要的效果。
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
#RewriteRule (.*?)$
#index.php?page=$1
</IfModule>
任何想法这可能是什么??
麦克雪豹。 我的目录在 DocumentRoot "/Library/WebServer/Documents" 中,我不使用普通的http://localhost/~User/,而是使用http://localhost/??等等
谢谢
更新:
多年来,我在其他事情上一直处于边缘地位。所以请在下面找到我的新详细信息,这些详细信息我仍然收到以下错误:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, you@example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
我的网址:
localhost/exp/index.php
我的htaccess:
RewriteEngine On
RewriteRule (.*?)/(.*?)/(.*?)$
exp/index.php?page=$1&action=$2&id=$3
如果我注释掉除“RewriteEngine On”之外的所有内容
RewriteEngine On
#RewriteRule (.*?)/(.*?)/(.*?)$
#exp/index.php?page=$1&action=$2&id=$3
我收到 403 禁止消息。我会在页面加载时将它们全部注释掉。
我的 /etc/apache2/httpd.conf 文件详情如下:
<Directory />
Options Indexes MultiViews FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
<Directory "/Library/WebServer/Documents/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
我将其用作我的本地主机,而不是我的用户一 localhost/~User/
所以我这辈子都不知道发生了什么事。
【问题讨论】:
-
这可能会或可能不会,但只是注意到如果我只通过访问 localhost 列出我的目录,那么我正在使用的 efolder 不可见???在其他文件夹列表中
标签: php mod-rewrite osx-snow-leopard