@addison
To remove index.php from the URL in CodeIgniter, you need to configure your web server and update the .htaccess file.
1
|
$config['index_page'] = 'index.php'; |
Change it to:
1
|
$config['index_page'] = ''; |
1 2 3 4 5 6 |
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> |
This code will remove index.php from the URL and redirect all requests to index.php.
For example, in your Apache configuration file or virtual host configuration, you should have something like this:
1 2 3 4 5 |
<Directory /var/www/html> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory> |
Restart your web server after making these changes, and you should now be able to access your CodeIgniter application without index.php in the URL.