How to remove Index.php from a custom built site

Avatar
  • Answered
Hi - I am the developer for the example.com. I have included an htaccess file intended to remove the index.php from the url. However, mod_rewrite does not appear to be turned on. Ok so I tried using the redirect feature:

example.com/index.php -> example.com

and indeed, it did remove the index.php, but then my site did not work.

So what should I do to get rid of the index.php and have my site work?

thanks Vincent Jacobs
Avatar
JacobIMH
Hello Vincent, I went ahead and removed your domain name and AMP verification from this public post. You only typically want to provide any private info when you are submitting a ticket directly to us. It looks like the .htaccess rules you're using should work. However for your application specifically because it looks like it's using CodeIgniter, you'll more than likely want to modify this file: /application/config/config.php Then look to change this line: $config['index_page'] = 'index.php'; To just read: $config['index_page'] = ''; Because this is what it says in the section above that, mentioning mod_rewrite:
|--------------------------------------------------------------------------
| Index File
|--------------------------------------------------------------------------
|
| Typically this will be your index.php file, unless you've renamed it to
| something else. If you are using mod_rewrite to remove the page set this
| variable so that it is blank.
|
If you're still having any issues at all please let us know! - Jacob