# sitemap.xml is 404



## Tact (Sep 9, 2002)

Hello everyone. I was hoping to get a little advice to help me understand the possible causes for the problem i'm having, and perhaps learn a few things so i can be more prepared when i decide to bug my host about this cause I think it will require me to bug them about it and i wanna make sure were on the same page when i do. 

Um, i've tried googling the heck out of my problem but no good. close calls but nothing worked. so..here we go.

I get a 404 error on my sitemap.xml in my root directory on my host even though i can see the file is right there in my ftp program. i thought it was just google's fault cause i can't upload my sitemap.xml (or .xml.gz) to them. but i tried just accessing it normally with the browser and i can't get it like that either. but i can see the file with my own eyes. it is there!

background information:

host: 1and1 internet
server: apache

sitemap generator in question... the official full purchased licence from this place
http://www.xml-sitemaps.com

installed, followed directions, created a file. saved a copy from the host to my pc to open it in there and looks good. if i open the file within the ftp program also looks good.

but accessing via browser or anything else. 404.

google results of similar problems had them go away for no reason and are working, and another suggested making sure i use the correct url between having www or without the www. test both. none good.

any ideas? where can i look next to further investigate this? what new keywords can i use to google and find more helpful results? anything would help.

thank you all very much. if you need anymore info just let me know.

oh and the site is http://www.legionofangels.net

the sitemap is right on root http://www.legionofangels.net/sitemap.xml (also have an extra that ends with .xml.gz if you wanna check that out too.

thanks again.


----------



## AQuickE (Feb 25, 2008)

Right click the sitemap.xml file and associate it (open with IE).


----------



## Tact (Sep 9, 2002)

thanks for the reply. it was already associated with IE. when i open it in my pc by double clicking it opens in IE and shows me it's contents. i did this with the file inside root and with a copy i have on my pc. 

and yet, when i try to access it through the website with the following address "http://www.legionofangels.net/sitemap.xml" i still get 404. even though i JUST successfully opened it manually as you said. 

i'm stumped. >.<


----------



## AQuickE (Feb 25, 2008)

I get the same 404 message. So, if it is really there, the file permissions need to be set properly via a chmod command.


----------



## tomdkat (May 6, 2006)

AQuickE said:


> I get the same 404 message. So, if it is really there, the file permissions need to be set properly via a chmod command.


A 404 error won't be returned if permissions don't allow access to the file. A 403 or some other "fobidden" oriented error will be returned.

Tact, you can do this: look at the error log for your site. It should be accessible via "cPanel" or whatever site control software your hosting providers makes available. In the error log, you will see the actual path Apache logs with the 404 error. You will then know exactly where Apache is looking for the file and probably know how to resolve the issue.

If you felt comfortable, you could post part of your error log file here so we could see it but it should be pretty self-explanatory. 

Peace...


----------



## AQuickE (Feb 25, 2008)

tomdkat,

Thank you, and I stand corrected becaused I did test the .htaccess file and received a 403 error; however, it is not uncommon for many commercial providers to have denied file access "custom" routed to a 404 and denied directory access routed to a 403.


----------



## AQuickE (Feb 25, 2008)

OK, I found your sitemap here: http://www.legionofangels.net/sitemap/ and it appears to have a customer routing error of 404. Caution: this thing looks unprotected...


----------



## Tact (Sep 9, 2002)

indeed it does doesn't it? >.< i don't tihnk just anyone should be able to use my xml generator like that. 

but yah you can see my settings from there. (any ideas how to protect that/limit access?)

i couldn't find how to see my logs via the admin panel. but i found that i can see them in my ftp

let me know if this is how it normally looks. i took out only a single entry i think. from what i think is it telling me where the person came from



> 68.84.208.144 - - [27/Feb/2008:18:25:15 -0500] "GET /sitemap.xml HTTP/1.1" 200 2361 www.legionofangels.net "http://forums.techguy.org/web-design-development/687277-sitemap-xml-404-a.html" "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)" "-"


let me know if that helps.

/me still stumpped and i made sure chmod was all correct before posting as well. thanks.


----------



## tomdkat (May 6, 2006)

Thanks for posting that. The entry is from the access_log file, which contains which files are being accessed by which IP addresses and browsers at those IP addresses. The "200" means the file was found by the web server. If the file couldn't be found, I believe a "404" would be where the 200 is.

The sitemap URL AQuickE posted above has a link to a HTML version of the XML sitemap. Is your host possibly having an issue with the sitemap file having a ".xml" file extension? What are the permissions on the sitemap.xml file according to your FTP client?

Peace...


----------



## Tact (Sep 9, 2002)

according to my ftp client, the permissions to both sitemap.xml and sitemap.xml.gz are both 666.

a reply from the forum where i got the software from suggests the following:



> Hello,
> 
> possibly your host has special handler setup on your server for XML files, please check that.


but i dont' understand what that means or how to correct it.

also. i have a vbulletin installed with vbseo which also uses .xml.gz and it has no problems. (though previously it did and then it somehow got fixed and i can't remember. >.<)

this sitemap i'm trying to work with is for the rest of the site outside the forum.


----------



## tomdkat (May 6, 2006)

Tact said:


> but i dont' understand what that means or how to correct it.


What they mean is your hosting provider, 1and1, might have the web server configured to NOT send "raw" XML files out and sends a 404 error instead. Ask tech support for your hosting provider if they have any ReWrite rules or filters setup to block sending "raw" XML files.

Peace...


----------



## Tact (Sep 9, 2002)

awesome. thanks! now i know exactly how to approach them when i bug em about it.

the whole time i was still clueless as to how i can phrase the questions so that i don't spend 30 minutes with them going back and forth troubleshooting a million things i already did.  hehe

btw i've heard of this rewrite thing....is this thing controlled through .htaccess files? cause i have one in root...which i THINK i put there to make vbseo work but since vbseo has nothing to do with the root and only handles the forum...i could prolly remove/edit or whatever to it. (i'll make a backup just in case)

but anyway. if you guys think these things are related, feel free to let me know if you can prolly spot the prob from what my file says.


```
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^view_(.*).htm$ view.php?pg=$1
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]
```
wow. i can almost already see that this indeed could have been the prob all along...>.<

/me deleting and testing

will edit back with results. 

EDIT:

score. it worked. and i suddenly remembered that this was prolly the same problem when i was dealing with my forums sitemap as well. -_- except that it needed corrections while this one needed to not have one at all. le sigh. lol

yah i don't think root needs .htaccess file does it? >.<


----------



## tomdkat (May 6, 2006)

Ah, it looks like that last RewriteRule might be the culprit. You could probably remove "sitemap" from the beginning of that line and your sitemap.xml file should be successfully found as desired.

I believe that current RewriteRule says "if a request comes in for sitemap.xml, load "sitemap.xml" from vbseo_sitemap/vbseo_getsitemap.php?sitemap=sitemap.xml" instead.

You should check your website control panel (cPanel or whatever) to see if they provide a sitemap generator for you. If they do, use theirs and leave the htaccess file alone.

Peace...


----------

