Error 500 and 404 when using .htaccess for removing index.php

19 May

By: Sochinda

Enable mod_rewrite in apache

  1. Enable ReWrite mode in Apache2
    $ sudo a2enmod rewrite
    $ sudo service apache2 restart
  2. Edit site-enable configuration
    <Directory /var/www/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride all
        Order allow,deny
        allow from all
  3. Add .htaccess
    Options +FollowSymLinks
    IndexIgnore */*
    <IfModule mod_rewrite.c>
     RewriteEngine on
     #RewriteBase /
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]
  4. Restart Apache2 Service
Leave a comment

Posted by on May 19, 2015 in Apache2, Yii


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: