Make WordPress Core

Opened 19 years ago

Closed 19 years ago

Last modified 19 years ago

#903 closed defect (bug) (fixed)

RSS Feed returns 404

Reported by: nlorenz's profile nlorenz Owned by: ryan's profile 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)

#2 @nlorenz
19 years ago

  • Patch set to No

#3 @toby
19 years ago

I, too, am having this problem.

#4 @toby
19 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 ...

#5 @ryan
19 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??

#6 @ryan
19 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.

#7 @ryan
19 years ago

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

#8 @toby
19 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.)

#9 @anonymousbugger
19 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.

#10 @nlorenz
19 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.

#11 @ryan
19 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.

#12 @toby
19 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?

#13 @ryan
19 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.

#14 @anonymousbugger
19 years ago

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

#15 @nlorenz
19 years ago

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

#16 @anonymousbugger
19 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?

#17 @anonymousbugger
19 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.

#18 @ryan
19 years ago

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

#19 @ryan
19 years ago

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