Fixing the 404 Error Using DD-Sitemap Generator & WP-Cache
After reviewing my latest Google Sitemap statistics, I noticed that there was an error being reported. The message stated that the link to my DD-sitemap was broken.
I quickly navigated there and found that everything was fine. The sitemap displayed as usual.
Confused, I checked the headers with Live HTTP Headers and found that my sitemap was sending a 404 error, which doesn’t make sense because the page loaded normally.
After thinking about the issue for a bit, and trying to contain my rage, I realized that the problem started after I installed the WP-Cache plugin. I went to my the plugin options to disable the sitemap from being cached, but that didn’t work.
So, I hacked the wp-config.php file in Wordpress, by adding the snibbet below, and seem to have fixed the issue:
if ($_SERVER['REQUEST_URI'] === '/sitemap/') {
header('HTTP/1.1 200 OK');
}
Now, a request for my sitemap page will always return a HTTP status of 200 and spiders can stop thinking the link is broken.
I’m not sure if this solution is bulletproof, but it seems to get the job done.
Help Me Improve!
- The only way for my posts to get better is to get your opinion! So help me out, and rate this one! Thanks!
Related Posts
SEO Wordpress Plugins You Shouldn’t Be Without
Continuing with my Wordpress love-fest this week, I thought I’d share some of my favorite SEO related plugins. However, Wo...
Sitemap
Directory World An ever growing human-edited website directory with quality categorised listings. Frequently Asked Inf...
Defining a “Good” Manager
Today was an eye opener. I'm not a "good" manager. :-/ But good news... I believe I just figured out how to become one. ...





