How to remove index.php in codeigniter on ubuntu server?
I have same problem. And I fix it.You must add .htaccess file in root directory of your site
RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule .* index.php/$0 [PT,L]
And main you must change site conf in /etc/apache2/apache2.conf.
Search Directory /var/www/Change AllowOverride None -> AllowOverride All
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted</Directory>
How to remove index.php in localhost(Ubantu) using codeigniter sudo nano /etc/apache2/apache2.conf write this code below. <Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> within codeigniter framework config/config.php In application/config/config.php change: $config['index_page'] = 'index.php'; to: $config['index_page'] = ''; $config['base_url'] = 'http://localhost/code_test'; make .htaccess file main folder directory<IfModule mod_rewrite.c> RewriteEngine On #RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [QSA,L]</IfModule>
Try this solution.
Paste this below code into .htaccess file and move it to you codeigniter folder
RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule .* index.php/$0 [PT,L]