apnerve
apnerve

Reputation: 4829

editing .htaccess file

I've made an application using CodeIgniter, and I tried to use the apache mod_rewrite rules as listed on the CodeIgniter User Guide as follows:

RewriteEngine on

RewriteCond $1 !^(index\.php|images|robots\.txt)

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

The problem is that I have this app in a folder abc/, but when I type mysite/abc/something (which should point to mysite/abc/index.php/something) I get redirected to mysite/index.php/something.

What changes should I make to the .htaccess file to make it work properly?

Upvotes: 3

Views: 549

Answers (2)

chaos
chaos

Reputation: 124297

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

Upvotes: 3

Gumbo
Gumbo

Reputation: 655239

Try using a relative path in the substitution:

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

Upvotes: 1

Related Questions