0
votes

I just installed bonfire, if I want manage a module I must go to

http://localhost/bonfire/public/index.php/admin/content/blog

I would like to remove index.php on the url and I would like to access my module like.

http://localhost/bonfire/admin/content/blog

Any ideas? i have googling and try any tutorials to remove index.php but it still failed until now

3

3 Answers

0
votes

Do add below code into the your .htaccess file. It will remove public/index.php from url

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ public/index.php/$1 [L]
</IfModule>

If .htaccess file is not present then do create it. And after adding this code if still not working then contact with server admin to make working this file.

0
votes

Add this code in your .htaccess file and place it on root directory

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|js|uploads|css|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

And change in your config file with this

$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
0
votes

Below are the steps of removing public and index.php from the website / application

  1. Move all files from public folder to the root (using older site structure).
  2. Edit root index.php and set $path = “.”;
  3. Rename 1.htaccess to .htaccess
  4. Edit .htaccess line 158 Rewrite-base / (add sub folder path if site hosted under sub directory)
  5. Open config.php in folder application/config and set $config[“base_url”] = “” and $config[“index.php”]=””

With these changes your CI Bonfire application will now have more user friendly urls.