【问题标题】:using .htaccess getting 500 internal server error使用 .htaccess 获得 500 内部服务器错误
【发布时间】:2014-10-07 20:14:45
【问题描述】:

我是.htaccess 的新手,我写了一个.htaccess 文件,比如

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule ^(.+) index.php?url=$1 [QSA, L]

现在我正在浏览器中运行我的网址,例如localhost/my_project/

它给了我以下错误

Internal Server Error

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.

我在我的 wamp 服务器中启动了rewrite module。还要检查错误日志,最后一行是

HTTP/1.1" 500 535

【问题讨论】:

  • 很可能mod_rewrite 未启用。
  • 它已启用我检查了httpd.conf

标签: php .htaccess wamp


【解决方案1】:

空间太大了!

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l

#Remove that space between QSA, and L
RewriteRule ^(.+) index.php?url=$1 [QSA,L]

【讨论】:

    猜你喜欢
    • 2016-09-22
    • 2017-04-05
    • 1970-01-01
    • 2013-02-06
    • 2015-06-28
    • 2016-04-20
    • 2014-01-01
    • 2018-05-10
    相关资源
    最近更新 更多