简体   繁体   English

Apache Mod重写-重写导致500错误

[英]Apache Mod Re-write - re-write causing 500 Error

I am using a go daddy virtual server and have uploaded the following htaccess: 我正在使用Go爸爸虚拟服务器,并上传了以下htaccess文件:

RewriteEngine on
RewriteCond $1 !^(index\.php?|images|styles|scripts|favicon\.ico|favicon\.png|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]

I am trying to remove index.php? 我正在尝试删除index.php? from the URL, but the fails causing 500 errors. 从URL,但失败会导致500错误。

Can anyone suggest why this may cause a 500 error? 谁能说出这可能导致500错误的原因? Thanks in advance 提前致谢

You cannot access $1 from the RewriteCond , since the RewriteCond is evaluated before the RewriteRule . 您不能从RewriteCond访问$1 ,因为RewriteCondRewriteRule之前进行求值。 Maybe that's it, and you should write: 也许就是这样,您应该写:

RewriteEngine On
RewriteCond %{REQUEST_URI} !^(index\.php|...)
RewriteRule ...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM