Welcome Guest, Not a member yet? Register   Sign In
Remove index.php without setting $config['index_page'] to empty string [SOLVED]
#1

[eluser]cseguin[/eluser]
Hi all,

I'm working on a app that is behaving correctly on the hosting but I'm not able to replicate this behaviour locally.

Let me explain:

Without touching anything in the code

Code:
http://127.0.0.1/item/2

returns a 404 and...

Code:
http://127.0.0.1/index.php/item/2

works fine

On the hosting

Code:
http://www.onlineshop.com/item/2

works fine.

The question is, why? Why does it work fine on the server and not in my machine?

in config.php

Code:
$config['base_url']    = "http://zeus/shoponline";
$config['index_page'] = "index.php";

here I have made the following modification:

Code:
$config['base_url']    = "http://127.0.0.1";

and the .htaccess file looks like this:

Code:
RewriteEngine On
RewriteBase /

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


# BEGIN Compress text files
<IfModule mod_deflate.c>
  <FilesMatch "\.(css|js|x?html?|php)$">
    SetOutputFilter DEFLATE
  </FilesMatch>
</IfModule>
# END Compress text files

# BEGIN Expire headers
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresDefault "access plus 1 seconds"
  ExpiresByType image/x-icon "access plus 2592000 seconds"
  ExpiresByType image/jpeg "access plus 2592000 seconds"
  ExpiresByType image/png "access plus 2592000 seconds"
  ExpiresByType image/gif "access plus 2592000 seconds"
  ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
  ExpiresByType text/css "access plus 604800 seconds"
  ExpiresByType text/javascript "access plus 216000 seconds"
  ExpiresByType application/javascript "access plus 216000 seconds"
  ExpiresByType application/x-javascript "access plus 216000 seconds"
  ExpiresByType text/html "access plus 600 seconds"
  ExpiresByType application/xhtml+xml "access plus 600 seconds"
</IfModule>
# END Expire headers

# BEGIN Cache-Control Headers
<IfModule mod_headers.c>
  <FilesMatch "\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
  </FilesMatch>
  <FilesMatch "\.(css)$">
    Header set Cache-Control "max-age=604800, public"
  </FilesMatch>
  <FilesMatch "\.(js)$">
    Header set Cache-Control "max-age=216000, private"
  </FilesMatch>
  <FilesMatch "\.(x?html?|php)$">
    Header set Cache-Control "max-age=600, private, must-revalidate"
  </FilesMatch>
</IfModule>
# END Cache-Control Headers

# BEGIN Turn ETags Off
<IfModule mod_headers.c>
  Header unset ETag
</IfModule>
FileETag None
# END Turn ETags Off

# BEGIN Remove Last-Modified Header
<IfModule mod_headers.c>
  Header unset Last-Modified
</IfModule>
# END Remove Last-Modified Header

I've through all docs available about the subject and always mention to set index_page to empty string for this to work.

Obviously there has to be another way. Does anyone know how is it done?

Thanks.


Messages In This Thread
Remove index.php without setting $config['index_page'] to empty string [SOLVED] - by El Forum - 08-04-2010, 09:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB