Removing index.php Problem

Hey guys,

Not sure why this is happening as I've setup CI a few times and never had a problem. However this time I can access my homepage ( yet when I click any of the links at the top I get a 404 error.

Here are the contents of my htaccess file:

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

My setup is as follows:

Zend Server 4.0 (Apache 2.2.14)
Windows Server 2003 Std R2

Starting to annoy me but think I've been looking at it for to long so here is a call for help!



Options +FollowSymLinks


Yep, already got that. In the log you just get the regular Apache 404 error.

Hey Martyn,

Have you tried

RewriteRule ^(.*)$ /index.php?/$1 [L]

with the question mark in there? Works for me on some servers when sub pages are throwing 404s.

Ah right, this will be if PATH_INFO isn't working properly right?

At work at the minute but will give it a try when I get home and let you know, cheers.

Just figured out I can RDP from work to the box, so done that restarted Apache and now I get the default page whenever I goto a different page.

Correct me if I'm wrong but PATH_INFO might not be working? Not sure how I correct that though.

Ok, so now whatever page I visit the page which is loaded is the main view for the controller. Proper confused now.

<IfModule mod_rewrite.c>

    RewriteEngine On

    RewriteBase /

    //Removes access to the system folder by users.
    //Additionally this will allow you to create a System.php controller,
    //previously this would not have been possible.
    //'system' can be replaced if you have renamed your system folder.

    RewriteCond %{REQUEST_URI} ^system.*

    RewriteRule ^(.*)$ index.php/$1 [L]

    //Checks to see if the user is attempting to access a valid file,
    //such as an image or css document, if this isn't true it sends the
    //request to index.php

    RewriteCond %{REQUEST_FILENAME} !-f

    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*)$ index.php/$1 [L]


<IfModule !mod_rewrite.c>
    // If we don't have mod_rewrite installed, all 404's
    // can be sent to index.php, and everything works as normal.

    ErrorDocument 404 /index.php


EDIT: never ever failed me.

Ok, done, now I get a 404 from CodeIgniter.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.