@jerad
To remove "index.php" from the URLs of a CodeIgniter site for SEO purposes, you can follow these steps:
- Open the CodeIgniter configuration file located at application/config/config.php.
- Look for the line that says $config['index_page'] = 'index.php'; and change it to $config['index_page'] = '';
- Next, you need to create a .htaccess file in the root directory of your CodeIgniter site. If there is already an .htaccess file, make sure to backup it before making any changes.
- Add the following code to the .htaccess file:
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>
|
- Save the .htaccess file and test your website to see if the "index.php" has been removed from the URLs.
By following these steps, you should be able to remove "index.php" from the URLs of your CodeIgniter site, which can help with SEO by creating cleaner and more user-friendly URLs.