Phil Poore
Phil Poore

Reputation: 2256

Code Ignighter - 404 showing, but correct response

i'm working on a website at work and recenctly move it via svn to my localserver so i can work from home...

The setup went okay, no majors... but code ignighter sends 404 Not Found on pages along with the correct response...

For example i can load 'localhost/home' and it fires my controller and i get correct view, but CI also send 404 in headers for the page....!! this also happens on my js files...

I can force it to send "200 OK", but doing this on every page seams silly..

Has anyone come accross this problem before...?

I'm using; Code Ignighter: 2.1.0

Apache : 2.0.63

PHP: 5.1.6

this is my .htaccess

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

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

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

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

<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

Upvotes: 0

Views: 267

Answers (1)

Ruben M&#252;ller
Ruben M&#252;ller

Reputation: 471

Give the .htaccess example from the documentation a try:

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

The following line could be responsible for your 404 response:

ErrorDocument 404 /index.php

Upvotes: 1

Related Questions