1

Possible Duplicate:
How to remove “index.php” in codeigniter’s path

1.create an .htaccess file in codeigniter directory with the following code

 <IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteBase /ex/
     RewriteCond $1 ^(application|system|private|logs)
     RewriteRule ^(.*)$ index.php/access_denied/$1 [PT,L]
     RewriteCond $1 ^(index\.php|robots\.txt|opensearch\.xml|favicon\.ico|assets|forums)
     RewriteRule ^(.*)$ - [PT,L]
     RewriteRule ^(.*)$ index.php/$1 [PT,L]
  </IfModule>

2.and change the config['index_page']='index.php' to config['index_page']=''

but it is not working. My httpd.conf(/etc/apache2/) is blank

Community
  • 1
  • 1

3 Answers3

1

Make sure you have enabled rewrite_module on your Apache modules

RewriteEngine On
RewriteBase /ex/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
hsuk
  • 6,321
  • 12
  • 45
  • 78
0

Try this in your .htaccess file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Venkata Krishna
  • 4,071
  • 5
  • 27
  • 52
0
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
rohitarora
  • 1,316
  • 2
  • 13
  • 20