Removing index.php Problem

#1
[eluser]martyncoup[/eluser]
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 (www.21yards.com) yet when I click any of the links at the top I get a 404 error.

Here are the contents of my htaccess file:

Code:
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!

Cheers!

Martyn.

#2
[eluser]w0bbes[/eluser]
Options +FollowSymLinks

?

#3
[eluser]martyncoup[/eluser]
Yep, already got that. In the log you just get the regular Apache 404 error.

#4
[eluser]adamfairholm[/eluser]
Hey Martyn,

Have you tried

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

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

#5
[eluser]martyncoup[/eluser]
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.

#6
[eluser]martyncoup[/eluser]
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.

#7
[eluser]martyncoup[/eluser]
Ok, so now whatever page I visit the page which is loaded is the main view for the controller. Proper confused now.

#8
[eluser]Ivar89[/eluser]
Code:
<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>

<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

</IfModule>

EDIT: never ever failed me.

#9
[eluser]martyncoup[/eluser]
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.