views:

308

answers:

4

This is what my .htaccess looks like. The .htaccess is sitting in /www/scripts directory which is the parent of codeigniter's "system" directory and which also contains index.php. I have enabled mod_rewrite in my Apache 2.2.x. This is on Ubuntu 9.10 server.

I followed this link, but it does not work. Is there anything i need to do in apache2, any specific configuration so that this works??

  • RewriteEngine on
  • RewriteBase /
  • RewriteCond %{REQUEST_FILENAME} !-f
  • RewriteCond %{REQUEST_FILENAME} !-d
  • RewriteRule ^(.*)$ index.php/$1 [QSA,L]
+1  A: 

Just toss the following code into your .htaccess file

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Source: http://codeigniter.com/user_guide/general/urls.html

Chris Schmitz
no this doesnt work :(
+3  A: 

use this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /folder/index.php/$1 [L]
sonill
i hope u have enabled mod_rewrite in ur server
sonill
yes i have enabled mod_rewrite, i think i made some progress, but now i get this error in apache error log, if .htaccess is enabled"Request exceeded the limit of 10 internal redirects due to probable configuration error"
yea it works now :))) thanks
you might want to check this as corrent answer. it will b easy for other users.
sonill
A: 

RTFM?

Phil Sturgeon