WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#3686 closed defect (bug) (duplicate)

index page gives 404 when using non-default permalinks

Reported by: jamesw Owned by: markjaquith
Milestone: Priority: low
Severity: normal Version: 2.1
Component: General Keywords: permalinks pages 404 error
Focuses: 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 (3)

AGEMAME HQ.htm (72.7 KB) - added by jamesw 7 years ago.
HTML of page using DumpEnv
.htaccess (922 bytes) - added by jamesw 7 years ago.
My .htaccess file
404on.htm (61.2 KB) - added by jamesw 7 years ago.

Download all attachments as: .zip

Change History (19)

jamesw7 years ago

HTML of page using DumpEnv

comment:1 Makki7 years ago

  • Keywords permalinks pages 404 error added
  • 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.

comment:2 ryan7 years ago

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?

jamesw7 years ago

My .htaccess file

comment:3 jamesw7 years ago

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.

jamesw7 years ago

comment:4 jamesw7 years ago

  • Resolution set to wontfix
  • Severity changed from normal to trivial
  • Status changed from new to closed

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.

comment:5 markjaquith7 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

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.

comment:6 o----o7 years ago

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

comment:7 jamesw7 years ago

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.

comment:8 jamesw7 years ago

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.

comment:9 follow-up: jberthon7 years ago

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.

comment:10 foolswisdom7 years ago

  • Milestone changed from 2.2 to 2.3

comment:11 foolswisdom7 years ago

  • Owner changed from anonymous to markjaquith
  • Severity changed from trivial to normal
  • Status changed from reopened to new

comment:12 in reply to: ↑ 9 f00f7 years ago

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.

comment:13 markjaquith7 years ago

  • Milestone changed from 2.3 to 2.4

comment:14 jamesw6 years ago

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.

comment:15 jamesw6 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

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?

comment:16 Nazgul6 years ago

  • Milestone 2.4 deleted
Note: See TracTickets for help on using tickets.