codeigniter .htaccess in amazon ec2 removal of index.php not working
You can change your .htaccess like this
RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule .* index.php/$0 [PT,L]
and change the value of "AllowOverride None" on /etc/httpd/conf/httpd.conf (if you use AMI Linux)
into "AllowOverride All"
after that restart your apache with command like this:
sudo service httpd restart
It's work and tested on my aws ec2.
(if you use ubuntu)Activate the mod_rewrite module with sudo a2enmod rewriteand restart the apache sudo service apache2 restartTo use mod_rewrite from within .htaccess files (which is a very common use case), edit the default VirtualHost with sudo nano /etc/apache2/sites-available/000-default.confSearch for “DocumentRoot /var/www/html” and add the following lines directly below: <Directory "/var/www/html"> AllowOverride All </Directory>Save and exit the nano editor via CTRL-X, “y” and ENTER.Restart the server again: sudo service apache2 restart
Justudin is correct!
Also you can use the "AllowOverride All" rule to only your project; writing in /etc/httpd/conf/httpd.conf something like this:
<Directory "/var/www/your_website"> AllowOverride All</Directory>