0

我正在使用以下htaccess代码url rewrite并且它正在工作。

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
#RewriteBase /

# If the request is for a valid directory
#RewriteCond %{REQUEST_FILENAME} !-d
# If the request is for a valid file
RewriteCond %{REQUEST_FILENAME} -f
# If the request is for a valid link
RewriteCond %{REQUEST_FILENAME} !-l
# do not do anything
RewriteRule ^ - [L]


# forward /john to user/profile.php?name=john
RewriteRule ^(.+)$ user/profile.php?username=$1 [L,QSA,NC]

但是,当我升级到最新的WAMP2服务器时,我开始收到下面的错误消息。

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost 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.

请有人能解释我为什么会收到这个错误,以及如何解决它。谢谢你。

4

2 回答 2

0

mod_rewrite 实际上是在服务器配置文件上关闭的,我打开它,重新启动服务器,它又开始工作了。

于 2012-12-10T22:55:03.070 回答
0

我遇到了同样的问题,但后来我发现在httpd.confmod_rewrite 中已被 Hashed out,这意味着它已关闭,所以我删除了行首的 # 并重新启动所有服务,它成功了!

于 2014-03-30T19:05:19.827 回答