#7306 closed defect (bug) (fixed)
Error 404 with /index.php/%postname%/ permalink strucutre
Reported by: | aarnet | Owned by: | markjaquith |
---|---|---|---|
Milestone: | 2.6.1 | Priority: | normal |
Severity: | normal | Version: | 2.6 |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
404 error appears on all permalinks when blog uses following permalink structure: /index.php/%postname%/.
Front page with posts shows OK. Clicking any post headings will give 404 error. Also archives (myblog.com/index.php/2008/07/) will give 404 error.
Pages (myblog.com/index.php/page title/) are working OK.
Tried with different themes and they all produce same error. Changing permalink scheme to default will solve problem but that's not an option normally.
My opinion is that bug appeared in V2.6 beta 3.
Change History (20)
#2
@
16 years ago
Here's where it got broken, in rewrite.php: [8213]
If those two options are blank, then that was supposed to me that the default values are supposed to be used. In that case, the tag_base and category_base would also be blank, and this code down in get_tag_permastruct handled the default value case:
if (empty($this->tag_base)) $this->tag_structure = $this->front . 'tag/'; else $this->tag_structure = $this->tag_base . '/';
By forcing the index.php into the tag and category bases, those values will never be blank if you use index.php in your permalink structure. Thus breaking permalinks for the default case of blank category/tag bases.
Adding a simple "category" and "tag" to those bases fixes it as a temporary solution, but ideally this code needs to be altered to use the default values as well, instead of just whatever get_option returns, which can be blank.
#3
@
16 years ago
- Milestone changed from 2.7 to 2.6.1
- Priority changed from normal to high
- Severity changed from normal to critical
- Version set to 2.6
#8
in reply to:
↑ description
@
16 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Replying to aarnet:
404 error appears on all permalinks when blog uses following permalink structure: /index.php/%postname%/.
Front page with posts shows OK. Clicking any post headings will give 404 error. Also archives (myblog.com/index.php/2008/07/) will give 404 error.
Pages (myblog.com/index.php/page title/) are working OK.
Tried with different themes and they all produce same error. Changing permalink scheme to default will solve problem but that's not an option normally.
My opinion is that bug appeared in V2.6 beta 3.
#9
@
16 years ago
I replaced my /wp-includes/rewrite.php file, that did not fix the error. Links such as myblog.com/blog/index.php/anything_here are not working.
#10
@
16 years ago
For a demonstration of the error, see my blog: http://www.virtualroadside.com/blog/ ... I'm at work now, so I can't debug it. I'll try looking at it tonight (6pm EST), thanks if you can figure it out before then.
#11
@
16 years ago
Did you force an upgrade. If you didn't replace the version.php, the upgrade that fixes your rewrite rules won't happen. You can either replace version.php with the new one or click "Save Changes" in your Settings->Permalinks page.
#12
@
16 years ago
Ah... that did fix it. Didn't realize thats how it worked. Thanks for the quick response! :)
#15
@
16 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Upgraded, had the 404 problem, applied the 3 files that are mentioned in 8366 (will update this post there too). Restarted Apache2. Weirdly it asked me to update/upgrade my database. I then went to the settings page, and selected save for the permalinks. Imagine this is the correct procedure, now it just gives me:
Not Found
The requested URL /2008/07/02/getting-out-to-the-ghettos-luanda/ was not found on this server.
It still works when I set to default, as in: http://www.nunnsby.com/?p=123
Have reopened, but just realised this now doesn't really apply to the 404 error anymore, but still an error.
Any ideas?
#16
@
16 years ago
Oh, just thought I would add to the above comment -
Category Base and Tag Base are both blank.
#17
follow-up:
↓ 18
@
16 years ago
- Resolution set to fixed
- Status changed from reopened to closed
Nunnsby: If you're not using "index.php" in your permalink settings, then this doesn't apply to you. Your error sounds like a straightforward .htaccess problem to me. Try the support forums.
#18
in reply to:
↑ 17
@
16 years ago
Replying to Otto42:
Hey Otto42, thanks, okay I was using index.php, and forgot to put it in, so fixed now.
How do I move away from having index.php in my permalinks? I am not using a .htacess file.
#19
@
16 years ago
- Priority changed from high to normal
- Severity changed from critical to normal
Nunnsby: This question is more suited for the support forums, so let's take it over there.
However, the basic answer to your question is that you must use an .htaccess file to avoid requiring index.php in the permalink string.
Appears to be caused by a conflict with the Tag base when using Pathinfo permalinks.
This is the Tag rewrite rule:
Which prevents Postnames from being matched.
One solution is to add category and tag basenames.