2

How do we remove the public/index.php from ci-bonfire 0.7 ?

I see there are instructions to remove the root index.php but I am unable to remove the root public/index.php and there are no instructions related to it.

I have tried instructions in http://cibonfire.com/docs/bonfire/removing_index without any success. I keep getting the 404 when I go to

http://localhost/Bonfire-0.7/index.php

but

http://localhost/Bonfire-0.7/public/index.php

works fine.

maan81
  • 3,469
  • 8
  • 36
  • 53

5 Answers5

0

Open directory application/config/config.php and do the following:

$config['index_page'] = '';
neubert
  • 15,947
  • 24
  • 120
  • 212
Moeed Farooqui
  • 3,604
  • 1
  • 18
  • 23
  • I am still not getting through. The site still needs to be accessed as `http://localhost/Bonfire-0.7/public/index.php/login` instead of `http://localhost/Bonfire-0.7/index.php/login` or `http://localhost/Bonfire-0.7/login` – maan81 Jan 06 '14 at 13:04
  • Basically, I am unable to remove the `public` from the url. – maan81 Jan 06 '14 at 14:01
0

I'm using XAMPP + bonfire v0.7, I've installed it under a subdirectory called "ci-bonfire", this is my solution.

To remove index.php in URL

Step 1: Goto ci-bonfire/application/config/config.php, remove "index.php" from index-page config.

$config['index_page'] = "";

Step 2: Change 1.htaccess in ci-bonfire/public/ to .htaccess update line #158, change to your subdirectory name

<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine On
  RewriteBase /ci-bonfire
  RewriteCond %{REQUEST_URI} ^bonfire/codeigniter.*
  RewriteRule ^(.*)$ /index.php?/$1 [L]
</IfModule>

and further down to line #182, prepend "public" to "index.php"

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

To remove public/index.php in URL

Step 1: Goto ci-bonfire/application/config/config.php, remove "index.php" from index-page config.

$config['index_page'] = "";

Step 2: Rename (for backup purpose) or remove index.php and .htaccess in your subdirectory, ci-bonfire

Step 3: Then refer to "Reverting To Traditional Structure" in this cibonfire's documentation. Move all files from public folder up 1 level to your subdirectory.

Step 4: Update index.php as the following

$path = ".";

Hope it helps, it works for me :)

justinw
  • 710
  • 8
  • 10
0

To remove public/index.php in Remote WebServer (in production)

Step 1: Goto application/config/config.php, remove "index.php" from index-page config.

$config['index_page'] = ""; (line 35)

Step 2: Remove index.php and .htaccess in your / (root)

Step 3: Move all files from /public folder to / (root).

Step 4: Update the new index.php in / as the following

$path = "."; (line 74)

It's all! Be happy!

0

Hello I had this error in CodeIgniter the installation in the server works such the next example:

SERVER_IP/public/index.php/controller/method

But I need

SERVER_IP/controller/method

My Solution is very very simple, my project is in the root directory then I go to the root directory and I have to create a .htaccess file configuration. like this:

<IfModule mod_rewrite.c>
   RewriteEngine On
   //Setting de base URL. 
   RewriteBase /public
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   //Setting the pattern to match 
   RewriteRule ^(.*)$ index.php/$1/ [L]
</IfModule>

The final result is:

Request: SERVER_IP/login => SERVER_IP/public/index.php/login

Request: SERVER_IP/login/doLogin => SERVER_IP/public/index.php/login/doLogin

Request: SERVER_IP/login/logout?noredirect=1 => SERVER_IP/public/index.php/login/logout?noredirect=1

Good Luck...

Community
  • 1
  • 1
allexiusw
  • 1,533
  • 2
  • 16
  • 23
-1

Try:

IR Carpeta : public/ Go folder public/

rename the public/ 1.htaccess to .htaccess

http://cibonfire.com/docs/developer/removing_index

Edit the .htaccess file and to add a RewriteBase option pointing to the folder that you're using around line 151 to 165 replace.

<IfModule mod_rewrite.c>
Options +FollowSymlinks
RewriteEngine On
RewriteBase /public
Jojodmo
  • 23,357
  • 13
  • 65
  • 107
galax
  • 1
  • 1