If you’re using google xml sitemap wordpress plugin, you will notice an error message as below when you’re accessing your sitemap
For example: http://domain.com/sitemap.xml
Error loading stylesheet: An unknown error has occurred (805303f4)
There is no problem with accessing your sitemap by adding http://www.domain.com/sitemap.xml
How to remove www infront of Google sitemap xml
Method A
Just Add The Following code To Your .htaccess
[code]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]
[/code]
Note:
1. Replace domain.com With Your Domain Name
2. Use If Your WordPress site Is Without www Means then Just Use The Following the reverse Order )
[code]
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.com [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
[/code]
Method B
I’m using Method B because is seem like the correct way to solve this error message.
Go to your Sitemap-core.php file located in your cpanel
/wp-content/plugins/google-sitemap-generator/sitemap-core.php
[code]
function GetDefaultStyle() {
$p = $this->GetPluginPath();
if(file_exists($p . "sitemap.xsl")) {
$url = $this->GetPluginUrl();
//If called over the admin area using HTTPS, the stylesheet would also be https url, even if the blog frontend is not.
if(substr(get_bloginfo(‘url’),0,5) !="https" && substr($url,0,5)=="https") $url="http" . substr($url,5);
return $url . ‘sitemap.xsl’;
}
return ”;
}
[/code]
Remove the above code and add below code
[code]
function GetDefaultStyle() {
$p = $this->GetPluginPath();
if(file_exists($p . "sitemap.xsl")) {
return ‘/wp-content/plugins/google-sitemap-generator/sitemap.xsl’;
}
return ”;
}
[/code]
Finally rebuild your sitemap manually in your wordpress dashboard settings
Interested to build website, kindly visit Web Design Malaysia
[Solved] Google XML Sitemap Stylesheet Error

Thanks ! easy fix with htaccess worked for me
Thank’s this is one important way…
tried method B and worked ! thanks.
Thanks! I used method B and it seems to have worked just fine! 🙂
tahank,,gan….finisss
thnx a ton….you made my day!! i’ve literally had it google XML sitemaps…
phew!
Legend. Method B works perfectly! Thanks
Method B works for me , wordpress 3.3.2
Method B is well.
Thanks.
Thanks!
This worked for me as well. Saved my day, thanks!
Thanks its work for my site 🙂
i am spending two days for this really thanks alot
Thanks for your help! Method B worked for my blog!
thankyou 🙂
Thanks. I used method B. Worked like a charm!
Thank you, the second method has worked perfectly for me to display my sitemap at http://www.freedogclassifieds.com/sitemap.xml .
But, what if one has many sites? (S)he has to log into every site and make the change? Awful !
By the way, is it a bug from the plugin itself or of wordpress?
Method B did the trick.
who’s the man? you are!
Thank you for this, just noticed my sitemap is not displaying. Will try your fix.
Cheers
thanks, it’s work..
Thanks,
I have fixed the issue on my site as you code.
Thanks, I have fixed my site as your code
Method B ok
Thanks Rosamun
Metod B
Works ok
Thanks
thanks
Looked like it should have worked, but I got the following error after I updated the file (using your Method B) and attempted to access Sitemap XML from WordPress admin:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ‘,’ or ‘;’ in /home/yeolde/public_html/wp-content/plugins/google-sitemap-generator/sitemap-core.php on line 2377
Any ideas?
M
Thank you 🙂
superb, i followed steps present in method B, it worked nicely, thanks lot i was thinking how to solve this issue, thanks for your wonderful help. i tired in mozilla, chrome it works flawlessly :). tons of thanks
HI,
thanks for the code, i followed the method 2, it works brilliantly, i tested in chrome and firefox, the problem is solved. thanks for your help
Hi
thanks for sharing the information, your Method B worked cool, thanks for sharing this code. thank you very much..
Hi,
Thanks for the information. I used Method B and it works.
thanks a lot that works!
Awesome…couldn’t get method B to work right, but method A worked like a charm. Google wasn’t able to index the sitemap correctly – Method A fixed it for me. Well done.
Hi,
Thanks so much for sharing the information, your Method B worked like a charm without having to alter the sitemap-core.php
Thanks! Used the B method and it worked like a charm. Used the latest version of the plugin – 3.4
Method B did not work for me at all.
thanks for sharing this info….i just fixed my error with option b
Thank you so much for this information.
I was really in need of this.
thnx 🙂
Hi ,
Thanks for your Helpful post !
After 3hours of surffing the web I’ve found this!
Thank you! Thank you! Thank you!
Thanks A lot !!!
THANK U FROM GERMANY :-*
Thank you so much! it’s really work.
Went with Method B and it worked perfectly. Took 2 minutes to get into the site and update the file.
http://www.funglawoffice.com
corrected page here:
http://www.funglawoffice.com/sitemap.xml
thx, the solution B works great on my site.