How To Remove Index php Url Path Codeigniter

The default URL display in the CodeIgniter app is not good to see because there is an index.php path. To remove index.php URL path CodeIgniter simply add a script to the .htacces file. Consider the following short tutorial.

Read another tutorial: Introduction – PHP Codeigniter Tutorial For Dummies Step By Step

PHP Codeigniter is a PHP framework that is liked by many people, for those of you who just do the installation CodeIgniter and access your project then you will surely see a less good view its URL like the example below:

Well so that better and easier to remember, then we will change its URL so like this

The way is quite easy, because we only need to make changes in config settings and create .htaccess file, okay now we will first create a file with the name .htaccess and we store in the root folder of our application, the contents of the file .htaccess as below:

And the next step is to change the bit setting of the CodeIgniter configuration. Change default settings

Be like the following

Then please access your project with the above URL above, if successful should your controller can be accessed correctly, but if not successful there is possibility mod_rewrite module from Apache not yet active. The solution tries to open httpd.conf file and find the following script:

And unmark #, so it looks like this:

After that, please restart apache and try to access. So my brief tutorial, hopefully, useful

The following two tabs change content below.
This site is a personal Blog of Sigit Prasetya Nugroho, a Desktop developer and freelance web developer working in PHP, MySQL, WordPress.

Leave a Comment

Your email address will not be published.

Time limit is exhausted. Please reload CAPTCHA.