简体   繁体   English

.htaccess总是显示500内部服务器错误代码

[英].htaccess always showing 500 Internal server error codeingiter

This is the .htaccess file which is my CI directory 这是.htaccess文件,这是我的CI目录

RewriteEngine on
RewriteCond $1 !^(index\.php|[Javascript / CSS / Image root Folder name(s)]|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

And this is my apache2.conf 这是我的apache2.conf

<Directory /var/www/>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

But this is showing 500 internal error. 但这显示了500个内部错误。

What is happening is there something wrong with what I have done?Please help 发生了什么事情我做的有什么问题请帮忙

Since your rule is not clearly shown I suspect either you have a syntax issue OR your rule is looping infinitely and causing 500. 由于您的规则未清楚显示,我怀疑您是语法问题,还是您的规则无限循环并导致500。

Replace your rule with this: 用以下内容替换规则:

RewriteEngine on

# If the request is not for a valid file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /index.php/$1 [L]

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

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