#codeigniter #php #mvc
Removing the index.php file
By default, the index.php file will be included in your URLs:
example.com/index.php/news/article/my_article
If your Apache server has mod_rewrite enabled, you can easily remove this file by using a .htaccess file with some simple rules. Here is an example of such a file, using the “negative” method in which everything is redirected except the specified items:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
In the above example, any HTTP request other than those for existing directories and existing files is treated as a request for your index.php file.
Note
These specific rules might not work for all server configurations.
Note
Make sure to also exclude from the above rule any assets that you might need to be accessible from the outside world.
On this page of the site you can watch the video online How to remove index.php from the url using codeigniter in Hindi with a duration of hours minute second in good quality, which was uploaded by the user Crew Era 29 September 2021, share the link with friends and acquaintances, this video has already been watched 103 times on youtube and it was liked by 4 viewers. Enjoy your viewing!