Skip to content
categoryWebsite Development

How to remove index.php from codeigniter in UBUNTU?

Ayyaz Zafar1 min read

This tutorial will show you that how to remove index.php from codeigniter in UBUNTU or how to enable url rewriting.

Step 1 :

Add this in htaccess file

Text
<IfModule mod_rewrite.c>  RewriteEngine On  #RewriteBase /  RewriteCond {3b3dd3986446f2411a115859dfb9ef0645ca07550196603d49955fcfabeac62d}{REQUEST_FILENAME} !-f  RewriteRule ^ index.php [QSA,L]</IfModule>

Step 2 :

Remove index.php in codeigniter config

Text
$config['index_page'] = '';

Step 3 :

Allow overriding htaccess in Apache Configuration (Command)

Text
sudo nano /etc/apache2/apache2.conf

and edit the file & change to

Text
AllowOverride All

for www folder

Step 4 :

Enabled apache mod rewrite (Command)

Text
sudo a2enmod rewrite

Step 5 :

Restart Apache (Command)

Text
sudo /etc/init.d/apache2 restart

Source

More in Website Development

All 86 →

Get new tutorials by email

One email when something new is published. Unsubscribe anytime.

Written by Ayyaz Zafar, full-stack developer for 15+ years. Work with me