500 internal server error because of .htaccess

So i got that error and the problem is in the .htaccess file. Here is the code:

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>

So can anyone suggest a solution for that problem? Thank you!

Upvotes: 0

Views: 72

Answers (1)

Abhishek Srivastava
Abhishek Srivastava

Reputation: 151

Please check error log go to the directory cd /var/log/apache2 type ls -->enter. if you have an error .htaccess: Invalid comman$

than have solved this issue by running a command.

sudo a2enmod rewrite && sudo service apache2 restart

Upvotes: 2

Related Questions