<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>404 &#8211; Blackbams Blog</title>
	<atom:link href="https://blog.blackbam.at/tag/404/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.blackbam.at</link>
	<description>development - digital arts - internet</description>
	<lastBuildDate>Wed, 05 Oct 2011 17:24:55 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>Remove the WordPress IIS 404 page problem by hack</title>
		<link>https://blog.blackbam.at/2011/06/12/remove-the-wordpress-iis-404-page-problem-by-hack/</link>
					<comments>https://blog.blackbam.at/2011/06/12/remove-the-wordpress-iis-404-page-problem-by-hack/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Sun, 12 Jun 2011 15:21:07 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Scripts]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[IIS]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=1419</guid>

					<description><![CDATA[While using WordPress on IIS 7 we were confronted with the problem that post loops without results or 404 pages on IIS where redirecting to the ugly default 404 pages of IIS instead of leading us to the WordPress ones. The most obvious possibility to solve this problem is to change the IIS server configuration. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>While using WordPress on IIS 7 we were confronted with the problem that post loops without results or 404 pages on IIS where redirecting to the ugly default 404 pages of IIS instead of leading us to the WordPress ones. The most obvious possibility to solve this problem is to change the IIS server configuration. Anyway I discovered that this 404 page redirection happens not till than WordPress starts sending its headers and only if there is no output until this event. So there is quite a funny hack to solve this problem &#8211; just send the XML-declaration (or anything else, like an empty string with whitespace) when the WordPress send_headers-action is performed, and the 404 pages will always be the WordPress ones.</p>
<p></p>
<pre lang="php">
add_action('send_headers','preventIIS404',999);
         
function preventIIS404() {
	echo('<?xml version="1.0" encoding="UTF-8" ?>');
}
</pre>
<p></p>
<p>Just be sure that you do not need to have any header()-redirections after this by plugins or your theme, because this will lead you to &#8220;Headers already sent&#8221;-errors.</p>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2011%2F06%2F12%2Fremove-the-wordpress-iis-404-page-problem-by-hack%2F&#038;title=Remove%20the%20WordPress%20IIS%20404%20page%20problem%20by%20hack" data-a2a-url="https://blog.blackbam.at/2011/06/12/remove-the-wordpress-iis-404-page-problem-by-hack/" data-a2a-title="Remove the WordPress IIS 404 page problem by hack"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2011/06/12/remove-the-wordpress-iis-404-page-problem-by-hack/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
