Welcome Guest, Not a member yet? Register   Sign In
Problem with rewrite htaccess

I know there are a lot of threads which deals with htaccess for removing index.php from the url.
I manage several sites with CI, but it's the first time I get that problem:
All works fine when I navigate with index.php/ in the url.

I use that htaccess:
RewriteEngine On
   # RewriteBase /msite/badges
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /msite/badges/index.php?/$1 [L]

And when I navigate without the index.php/ in the url, it always loads the view named index.php.
Even when I try to get to another controller/method.

What could be the problem please?

Are you certainly sure that mod_rewrite is enabled ?

Yes, in fact this project is in a subdirectory of the main domain. I'm using url rewriting on the main site, so that subdir is mod_rewrite activated I guess!!

Can you paste please $config['base_url'] = ??, $config['index_page'] = ?? ... I suppose you dont't have strange routes.php ;-). And you can try in your .htaccess RewriteRule ^(.*)$ /msite/badges/index.php/$1 [L] - look at missing '?'.

i have a project in a sub folder and i use this:
Quote: RewriteEngine On
RewriteBase /test/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

works for me!

I also had a probleme like that and i resolve it just as you told me.tank you very much

I know it's very often a problem of rewrite rule when people face bugs with that, but here I've just resolved my problem:
I set in my config file:
$config['uri_protocol']    = 'QUERY_STRING';
AUTO and PATH_FILE didn't work. Hope it will help someone

Theme © iAndrew 2016 - Forum software by © MyBB