Ticket #3686 (closed defect (bug): duplicate)

Opened 2 years ago

Last modified 1 year ago

index page gives 404 when using non-default permalinks

Reported by: jamesw Assigned to: markjaquith
Priority: low Milestone:
Component: General Version: 2.1
Severity: normal Keywords: permalinks pages 404 error
Cc:

Description

I'm using Wordpress 2.1, and find that when I set my permalinks to /%year%/%monthnum%/%day%/%postname%/, my index.php page becomes a 404 (As a workaround, I'm sending all 404 requests to the main page).

I attach a DumpEnv? version of the requested index page.

Oh, and my blog is at http://www.mameworld.net/agemame/

Attachments

AGEMAME HQ.htm (72.7 kB) - added by jamesw on 01/26/07 13:11:17.
HTML of page using DumpEnv?
.htaccess (0.9 kB) - added by jamesw on 01/27/07 20:51:13.
My .htaccess file
404on.htm (61.2 kB) - added by jamesw on 01/27/07 20:58:39.

Change History

01/26/07 13:11:17 changed by jamesw

  • attachment AGEMAME HQ.htm added.

HTML of page using DumpEnv?

01/26/07 21:29:51 changed by Makki

  • keywords set to permalinks pages 404 error.
  • milestone changed from 2.3 to 2.2.

I am suffering this same problem. since 2 days ago. I have no idea how to resolve this issue.

01/26/07 23:40:32 changed by ryan

Is that dumpenv output from after you employ the 404 handler workaround? If so, it's not going to be very helpful.

Without the workaround, are you getting the WP issued 404 page or the server issued one? What does your .htaccess look like?

01/27/07 20:51:13 changed by jamesw

  • attachment .htaccess added.

My .htaccess file

01/27/07 20:58:09 changed by jamesw

My 'workaround' was simple to delete 404.php from my theme, so that Wordpress 404's came back to my index page.

I enclose the DumpEnv? output which occurs when I don't do that, just in case.

01/27/07 20:58:39 changed by jamesw

  • attachment 404on.htm added.

02/02/07 10:21:16 changed by jamesw

  • status changed from new to closed.
  • resolution set to wontfix.
  • severity changed from normal to trivial.

I have found the issue - in wp-settings.php there is a fix for IIS servers, starting on line 28.

In my case, REQUEST_URI is not empty, but it is wrong, so line 29:

if ( empty( $_SERVERREQUEST_URI? ) ) {

Needs to become:

{

to force the change.

This would mean that it's not a bug, more a config issue that needs to be suggested to affected users in the documentation, or on the forums.

02/02/07 14:22:30 changed by markjaquith

  • status changed from closed to reopened.
  • resolution deleted.

wp-settings.php isn't a user-modified file. It's part of core. So if we can account for your circumstance there, we should. We shouldn't be telling people to modify core files.

02/02/07 21:11:42 changed by o----o

have similar problem when I use ' in the name for ie. in the page name "Le Déjeuner sur l’Herbe (2006)" then the wordpress creates a link in the menu, but is pointed to a bad page(link).

jm

02/03/07 22:11:48 changed by jamesw

OK, before I put the fix in, my REQUEST_URI was http://www.mameworld.net/agemame/ - which is my HOME, or SITEURL. After the fix went in,. it became /agemame/index.php

Does that mean that we can add to the IIS test another option for if REQUEST_URI = SITEURL, as that appears to be what's wrong.

I'll try some other tests, and see if there's a reliable patch I can make, unless someone beats me to it.

02/08/07 13:25:30 changed by jamesw

Right, after check on a number of blogs on the same server, it appears that the common symptom is that their REQUEST_URI is set to the directory, they are in, not the relative path to index.php (See previous message).

However, I don't know how to reliably test for that, so I can't provide a patch for it.

(follow-up: ↓ 12 ) 03/22/07 14:05:34 changed by jberthon

I have also the problem. My custom permalink is: /%category%/%postname%
With Wordpress 2.1.2 and Apache/2.2.3 (Ubuntu) mod_python/3.2.10 Python/2.5 PHP/5.2.1 this is not working. I mean on the front page, the links are displayed correctly for all articles, but when clicking on an article I get a HTTP 404 error.

One "workaround" was to add /index or /index.php before my custom string (any other entries fails). So if I put /index.php/%category%/%postname% then my permalinks are all correct, by that I mean that I can click and view the articles instead of the 404 error page.

03/27/07 17:45:53 changed by foolswisdom

  • milestone changed from 2.2 to 2.3.

09/18/07 18:18:08 changed by foolswisdom

  • owner changed from anonymous to markjaquith.
  • status changed from reopened to new.
  • severity changed from trivial to normal.

(in reply to: ↑ 9 ) 09/20/07 12:31:42 changed by f00f

Replying to jberthon:

I have also the problem. My custom permalink is: /%category%/%postname%
With Wordpress 2.1.2 and Apache/2.2.3 (Ubuntu) mod_python/3.2.10 Python/2.5 PHP/5.2.1 this is not working. I mean on the front page, the links are displayed correctly for all articles, but when clicking on an article I get a HTTP 404 error. One "workaround" was to add /index or /index.php before my custom string (any other entries fails). So if I put /index.php/%category%/%postname% then my permalinks are all correct, by that I mean that I can click and view the articles instead of the 404 error page.

Don't get me wrong, but that sounds like mod_rewrite was not working properly.

09/22/07 06:14:57 changed by markjaquith

  • milestone changed from 2.3 to 2.4.

11/01/07 12:14:56 changed by jamesw

If it helps anyone diagnose what's wrong, I've set up a PHPInfo page that should allow those a bit better skilled to see what my potential problem might be.

http://www.mameworld.net/agemame/test.php

I haven't tried the workaround listed above, as I'm reluctant to change permalink structures, particularly since I already have issues with canonical redirects. I'm not posting a ticket for that, though, because it's probably down to my REQUEST_URI being screwed up.

11/19/07 15:44:22 changed by jamesw

  • status changed from new to closed.
  • resolution set to duplicate.

Looking into this, it appears this problem is due to Squid, much like http://trac.wordpress.org/ticket/3820

Perhaps someone of suita ble authority could merge the tickets?

11/19/07 15:53:08 changed by Nazgul

  • milestone deleted.