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

[eluser]jgrmstr[/eluser]
Hi,
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:
Code:
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?
#2

[eluser]mlinuxgada[/eluser]
Are you certainly sure that mod_rewrite is enabled ?
#3

[eluser]jgrmstr[/eluser]
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!!
#4

[eluser]mlinuxgada[/eluser]
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 '?'.
#5

[eluser]allaerd[/eluser]
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!
#6

[eluser]Unknown[/eluser]
I also had a probleme like that and i resolve it just as you told me.tank you very much
#7

[eluser]jgrmstr[/eluser]
Hi,
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:
Code:
$config['uri_protocol']    = 'QUERY_STRING';
AUTO and PATH_FILE didn't work. Hope it will help someone




Theme © iAndrew 2016 - Forum software by © MyBB