WordPress.org

Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#903 closed defect (bug) (fixed)

RSS Feed returns 404

Reported by: nlorenz Owned by: ryan
Milestone: Priority: normal
Severity: major Version: 1.5
Component: General Keywords:
Focuses: Cc:

Description

Every time I attempt to access my feeds (RSS, Comments RSS, Atom, etc) I receive a 404 error. I've read on the forums about changing the file permissions for those folders but that hasn't worked. I also attempted to change the permalink structure but then the feed returned a No Input File Specified error. My hosting provider is running IIS, so the .htaccess solutions don't apply. I've posted on the forums, but this seems to be a large spread issue for the IIS users with no resolution yet so I thought I would post it here. Any assistance you can provide would be much appreciated.

You can access my feeds at http://www.radicalwacko.com/blog/. And example of the 404 error can be found at http://www.radicalwacko.com/blog/wp-rss2.php

Change History (19)

comment:2 @nlorenz11 years ago

  • Patch set to No

comment:3 @toby11 years ago

I, too, am having this problem.

comment:4 @toby11 years ago

Not sure why these lines are there, but if you comment out lines 112-115 of wp-blog-header.php, RSS feeds work. In other words, take these lines:


if ( preg_match('/cgi/', php_sapi_name()) )

@header('Status: 404 Not Found');

else

@header('HTTP/1.x 404 Not Found');


and turn them into this:


/* if ( preg_match('/cgi/', php_sapi_name()) )

@header('Status: 404 Not Found');

else

@header('HTTP/1.x 404 Not Found'); */


Your RSS feed works. Again, still not sure why they are pre-loading the headers with a 404 error ...

comment:5 @ryan11 years ago

We may be falling into the PATH_INFO processing code at the top of the blog header and setting $error. See this bit of code at the top.

if ((isset($_GETerror?) && $_GETerror? == '404')

((! empty($_SERVERPATH_INFO?)) &&
('/' != $_SERVERPATH_INFO?) &&

(false === strpos($_SERVERPATH_INFO?, 'index.php'))

)) {

What is the value of $_SERVERPATH_INFO??

comment:6 @ryan11 years ago

Hmm, I bet this only happens when directly visiting wp-rss2.php and not when using permalinks (which route through index.php). Thus, wp-rss2.php is put in PATH_INFO by IIS, which slips through our checks. Perhaps instead of checking for 'index.php' in PATH_INFO we could check for just '.php'. Unless someone has a more elegant solution.

comment:7 @ryan11 years ago

  • Owner changed from anonymous to rboren
  • Status changed from new to assigned

comment:8 @toby11 years ago

You are correct that I am linking directly to that file. My template calls for the value of <?php bloginfo('rss2_url'); ?> and returns that file. (I'm not using permalinks.) Is there a parameter that should be passed to index.php in order to request the RSS/Atom/RSS2/etc. feeds instead of directly linking to this file? Why check for the executing script? (I am just curious.)

comment:9 @anonymousbugger11 years ago

Thanks for the quick response and the temporary fix.

$_SERVERPATH_INFO? returns "/blog/wp-rss2.php", so yes.

Also, this does only happen when I have not specified a permalink format and I go directly to wp-rss2.php. When I specify a permalink structure and go to the "/feed/" link, I get "Input File Not Specified" as the error.

Hope that helps.

comment:10 @nlorenz11 years ago

Thanks for the quick response and the temporary fix.

$_SERVERPATH_INFO? returns "/blog/wp-rss2.php", so yes.

Also, this does only happen when I have not specified a permalink format and I go directly to wp-rss2.php. When I specify a permalink structure and go to the "/feed/" link, I get "Input File Not Specified" as the error.

Hope that helps.

comment:11 @ryan11 years ago

You can call index.php?feed=rss2.

PATH_INFO is usually blank if no actual path information is passed. Some setups, however, set path info to the executing script or other stuff rather than leaving it blank when there is no path info. This screws us up and is the reason for the index.php check. Unforunately, we forgot to account for feeds when working around this.

Can you try changing the check to the following and see what happens.

(false === strpos($_SERVERPATH_INFO?, '.php'))

It's ugly, I don't like it, but hopefully it will suffice for now.

Thanks for your help with the IIS problems.

comment:12 @toby11 years ago

Yup, your fix works for now. Why doesn't bloginfo('rss2_url') return index.php?feed=rss2? Is there a setting that can do that?

comment:13 @ryan11 years ago

I was going to change it to use index.php but forgot. Actually, I forgot to write the bug report that would remind me not to forget.

There isn't a setting to change it. I might make the change for 1.5.1.

comment:14 @anonymousbugger11 years ago

This workaround resolved the same issue I was having as well.

comment:15 @nlorenz11 years ago

That works like a dream. Thank you all very much. I'm glad to see Wordpress take such great steps forward.

comment:16 @anonymousbugger11 years ago

"You can call index.php?feed=rss2."

This works for me.
One question: what will the ending be for the rss on comments?

comment:17 @anonymousbugger11 years ago

For comments:

index.php?feed=rss2&withcomments=1

For 1.5.1, I'll probably change it so that you can do index.php?feed=comments-rss2 or something similar.

comment:18 @ryan11 years ago

  • fixed_in_version set to 1.5
  • Resolution changed from 10 to 20
  • Status changed from assigned to closed

comment:19 @ryan11 years ago

  • fixed_in_version changed from 1.5 to 1.5.1
Note: See TracTickets for help on using tickets.