• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to access robots.txt file on tomcat 6 server

 
Tony Ghy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry if i sound silly, but I'm facing a weird problem.

I made a robots.txt file and uploaded it to my Tomacat 6 webapps/ROOT folder, but when I try to access it through http://www.this-is-not-my-real-domain-name.com/robots.txt I get a 404 not found error.
I restarted the server multiple times, without success. I've also checked the mime type on the server's web.xml file.

What am i doing wrong?
Isn't it supposed to be simple.

Please help me out. I would really appreciate it.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18277
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Tomcat root application is a little bit different from other webapps. You can't just patch stuff into the default root app the way you could any other deployed app. There are instructions on how to do this in the Tomcat docs at tomcat.apache.org.
 
Tony Ghy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:The Tomcat root application is a little bit different from other webapps. You can't just patch stuff into the default root app the way you could any other deployed app. There are instructions on how to do this in the Tomcat docs at tomcat.apache.org.


I searched the documentation but couldn't find any help.

Can someone please guide me.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My robots.txt works just fine in Tomcat6.

What other files do you have in webapps/ROOT ?

Did you use the default <welcome-file-list> contents?

What do you get for a plain request to "http://yourdomain/" ?

Bill
 
Tony Ghy
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:My robots.txt works just fine in Tomcat6.

What other files do you have in webapps/ROOT ?

Did you use the default <welcome-file-list> contents?

What do you get for a plain request to "http://yourdomain/" ?

Bill


My webapps/ROOT contain the following:

META-INF
resources
WEB-INF
index.jsp
robots.txt

My Welcome file list contains:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>

A plain request to http://yourdomain/ works fine. My site is in production & working just fine. Only robots.txt file is not accessible.


Please guide.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13071
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is really mysterious!

If this was my problem I would be looking for clues in the log files.

I would also try putting a robots.txt file in another web application to see if only the ROOT is affected.

Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic