CodeIgniter uses the segment-based approach to design URLs human-friendly or seo-friendly. By default, the index.php file will be included with the URLs in CodeIgniter. But you can easily remove the index.php from the URL using .htaccess.
By default, all URLs in CodeIgniter looks like the below.
http://codexworld.com/index.php/tutorials/
By defining some simple rules in the .htaccess file, the index.php file can easily be removed from URL in CodeIgniter. To rewrite URLs using HTACCESS, mod_rewrite need to be enabled in your Apache server. Create a .htaccess file in the root directory of your project and place the following code in the .htaccess file.
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L]
Now, you can access URLs without index.php in CodeIgniter.
http://codexworld.com/tutorials/
very good
How do you do it for CI 3 for HTTPS link’s. Works fine on http links
Modification not needed, this code will also work on CI 3 with HTTPS.
Am already looking for this article for remove index.php from URL in CodeIgniter according to your example I have to rewrite and set up the root directory of my project source code. Nice Post Codexworld
HOW to enable mod_rewrite in Apache server, and which is the root directory can you PLEASE give a detailed explanation of the above process ?????
See this tutorial to enable mod_rewrite in Apache – http://www.codexworld.com/enable-mod_rewrite-apache-server-ubuntu/