I\'m running a LAMP environment with CodeIgniter. I want to be able to use its URL pattern, like, http://localhost/controller/function/ID
, but by default it has
Had some problems with finding where to change the "AllowOverRide All".
From this guide I found the (default) file.
Remove Index.php CodeIgniter URL On Ubuntu
Preliminary Note. I'm running all the steps in this tutorial with root privileges, so make sure you're logged in as root:
sudo su
Enable mod_rewrite module on apache. First enable the module as follows:
a2enmod rewrite
Change all occurrence of "AllowOverRide None" to "AllowOverRide All". Basically all "None" to "All" in the following file:
gedit **/etc/apache2/sites-available/default**
Restart Apache:
/etc/init.d/apache2 restart
Open file config.php on CodeIgniter (application\config).
Remove index.php on $config['index_page'] = "index.php";
$config['index_page'] = "";
Make file .htaccess on CodeIgniter root directory. Fill the file with this code :
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Now Index.php on CodeIgniter URL disappear