0

I'm deploying the web application that we made in our live server but then im having troubles in figuring out how to remove index.php. i have read several blogs regarding how to remove index.php in codeigniter application.

i have tried this settings on my .htaccess

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

and on my config.php

$config['index_page'] = '';

$config['uri_protocol'] = 'REQUEST_URI';

but i still can't figure out how to remove it. Do i need to edit something in the apache httpd.conf?

thanks!

1
  • do you have mod_rewrite enabled on your apache server? Commented Jul 9, 2011 at 0:40

2 Answers 2

0

Can you try removing the ? that is present after index.php in your .htaccess:

Change:

RewriteRule ^(.*)$ index.php?/$1 [L]

To:

RewriteRule ^(.*)$ /index.php/$1 [L]
Sign up to request clarification or add additional context in comments.

2 Comments

i have changed the .htaccess into this settings RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php/$1 [L] RewriteCond %{REQUEST_URI} ^application.* RewriteRule ^(.*)$ /index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] and still nothing happens
The following settings are mentioned on CodeIgniter website: RewriteEngine on RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ /index.php/$1 [L]
0

This is the one I use. Tried 3 different ones before I found one that worked

DirectoryIndex index.php
RewriteEngine on

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.