ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

links returning 404 that aren't 404

July 16, 2007 11:45pm

Subscribe [1]
  • #1 / Jul 16, 2007 11:45pm

    Leonard M

    24 posts

    I’m working on a site where the index.php is removed in .htaccess using the include list method as below:

    DirectoryIndex index.php
    
    <Files index.php>
        AcceptPathInfo on
        SetOutputFilter PHP
        SetInputFilter PHP
    </Files>
    
    RewriteEngine On
    RewriteCond $1 ^(about|P[0-9]{2,8}) [NC]
    RewriteRule ^(.*)$ index.php/$1 [L]

    I have a template with a link to itself. When the a href link is http://www.domain.com/index.php/about the link works just dandy.

    When the link is http://www.domain.com/about the link returns a 404.

    However (and this is the weird part), when I click on the URL in the address bar, make absolutely no changes and simply hit return, the link returns the correct page.

    Any ideas why this may be? The site is yourtownmemories if you’d like to take a look and see what I’m talking about (while it’s still broken!)

  • #2 / Jul 17, 2007 10:24am

    Robin Sowell

    13255 posts

    I THINK it has something to do with caching.  I was playing around with FF showing live headers and that’s the only difference I could find.  I think when it works, it pulls from cache and when it doesn’t- it doesn’t.  But that’s not definitive.

    I’m not sure if this is a server thing or an htaccess thing- or a combo.  It definitely works fine if you remove the htaccess and use the index.php in there?  Check that every way you can.  We want to make sure it’s working.

    If it works without the htaccess- then you’ll need to start tweaking on that- I’ve seen it vary server to server- and some won’t allow it at all.  The most forgiving approach seems to be the file and directory check method.  I might try it just to see if it works that way.  If so, we can go from there.

  • #3 / Jul 19, 2007 2:48pm

    Leonard M

    24 posts

    I turned off query caching and cleared the cached data files but it still happened.

    It also worked without the .htaccess (but then the index.php appears in the URLs). I switched to the file and directory method and it does work that way, but the SEO warning was what put me off that method.

    I finally figured out the solution though: switching Admin>>System Preferences>>Output and Debugging Preferences>>Force URL query strings to No. I must have switched it to yes at some point and not switched it back.

    Thanks for the pointers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases