500内部服务器错误,因为.htaccess

500内部服务器错误,因为.htaccess,.htaccess,.htaccess,所以我得到了那个错误,问题出在.htaccess文件中。 代码如下: DirectoryIndex index.php Options -MultiViews -Indexes +FollowSymLinks <IfDefine APACHE2> AcceptPathInfo On </IfDefine> <IfModule rewrite_module> RewriteEngine On RewriteBase / #R

所以我得到了那个错误,问题出在.htaccess文件中。 代码如下:

DirectoryIndex index.php
Options -MultiViews -Indexes +FollowSymLinks

<IfDefine APACHE2>
    AcceptPathInfo On
</IfDefine>

<IfModule rewrite_module>
    RewriteEngine On
    RewriteBase /

    #RewriteCond %{HTTPS} !on
    #RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    # RewriteRule (.layout1\.htm) templates$1 [QSA,L]
    RewriteRule ^$ index.php?/ [QSA,L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule (.*) index.php?/$1 [QSA,L]
</IfModule>
DirectoryIndex.php
选项-多视图-索引+FollowSymLinks
上的AcceptPathInfo
重新启动发动机
重写基/
#重写cond%{HTTPS}!在…上
#重写规则(.*)https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301]
#重写规则(.layout1\.htm)模板$1[QSA,L]
重写规则^$index.php?/[QSA,L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则(.*)index.php?/$1[QSA,L]

那么有人能为这个问题提出解决方案吗?谢谢大家!

请检查错误日志,转到目录cd/var/log/apache2 键入ls-->回车。 如果您有错误。htaccess:无效的命令$

而不是通过运行命令来解决此问题

sudo a2enmod rewrite && sudo service apache2 restart

检查错误日志文件,对于linux,它位于
/var/log/httpd
/var/log/apache2