Opened 16 years ago
Closed 16 years ago
#8076 closed defect (bug) (fixed)
General feed doesn't work with permalink without mod_rewrite
Reported by: | schlafbaum | Owned by: | markjaquith |
---|---|---|---|
Milestone: | 2.7 | Priority: | high |
Severity: | normal | Version: | 2.7 |
Component: | Permalinks | Keywords: | |
Focuses: | Cc: |
Description
If I use permalinks starting with /index.php/ the general feed does not work. The link to the feed is correctly given as www.site.com/index.php/feed, but redirects to www.site.com/feed which leads to error 404. Same does index.php?feed=rss2
Config:
No .htaccess-file
No mod_rewrite
Permalink-structure: /index.php/%year%/%monthnum%/%postname%/
Change History (12)
#2
@
16 years ago
Using canonical.php from 2.6.3 instead of the one from newest beta works fine, canonical.php from Changeset 9156 does not.
#3
@
16 years ago
Stripping off index.php in row 145 canonical.php causes this error.
Commenting it out works fine. Don't know what this does to other feeds...
#6
@
16 years ago
the wiki syntax breaks the above line. New try:
('#/feed([/a-z0-9-]*?(/+)?)?$#', '/', $paged_redirect['path']);
#7
@
16 years ago
I tried changing line 141 and removing comments in line 145 but this does not work for me: index.php is still disappearing from url, leaving me with 404 on www.site.com/feed.
I don't know, when index.php should be stripped: I tried my working version with /index.php/%year%/%monthnum%/%postname%/ and /%year%/%monthnum%/%postname%/ (with mod_rewrite activated) and all feeds seem to work.
#8
@
16 years ago
Do you delete your bowser cache?
The problem is, that the regex in line 141 doesn't match the default feed URI. The default feed has no characters behind the last slash ".../index.php/feed/" but the regex matches after the slash. Therefore the statement in line 145 becomes effective.
Changing #/feed(/[a-z0-9-]
to #/feed([/a-z0-9-]
must work ...
#9
@
16 years ago
yes, I emptied the browser cache. It does not work with preg_replace('#/feed([/a-z0-9-]*?(/+)?)?$#', '/',
The replacement in line 145 is done, however I put the slash outside or inside the brackets. This is done in both cases (did some logging):
After line 137, $paged_redirect['path']
is "site/index.php/feed/"
After line 143, $paged_redirect['path']
is "site/index.php/"
After line 145, $paged_redirect['path']
is "site/"
This is looped once more without /index.php/
Without line 145, it remains "site/index.php" and is not looped
For reference, Here's the commit/ticket for Canonical feeds: