3

So basically I have the same problem described here and there. I tried everything described (and much more...), but anyway. Here is my .htaccess :

RewriteEngine on

RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

I tried various things, like adding a "/" before the "index.php" or without the "?" after the "index.php", but it didn't change anything.

We have exactly the same file in the development environment, but when moving to production, I just can't get the index.php to disappear. The only difference between the two environment are their location on their respective server (.../public_html/APP versus .../public_html/sub-domains-name/APP), I don't think it's related, but I already had some problems with CI when moving the application around, so maybe there's something there.

Oh and finally, here are the related line in the config.php :

$config['base_url'] = "http://www.domain.com/";
$config['index_page'] ='';
$config['uri_protocol'] = "AUTO";

EDIT Also, since the production and development environment are on the same server, I already ruled out the possibility of a configuration problem on behalf of apache.

EDIT2 I tried to create a sub-directory on the production server and migrated the website there (www.domain.com/test/). Everything work fine like this... So there's definitely a configuration parameter I'm missing somwhere.

2
  • regarding your edit - being on "the same server" (by means of a logical server) doesn't necessarily mean that apache uses the same config for both deployments. Commented Feb 3, 2010 at 20:36
  • yeah good point, I'll ask the server admin about that. Commented Feb 3, 2010 at 20:42

1 Answer 1

1

I use the same rewrite rule in my application. Try this: Change

$config['uri_protocol'] = "AUTO";

to become

$config['uri_protocol'] = "QUERY_STRING";

It's working well in mine.

Try to dive the apache access log and error log, to find out where the browser request is routed by apache and how your CI get that request. Activating log in CI helps too:

$config['log_threshold'] = 2;

Don't forget to set appropiate permission to system/logs directory, so apache can write log file to it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.