aspose file tools*
The moose likes Tomcat and the fly likes Unable to access robots.txt file on tomcat 6 server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Unable to access robots.txt file on tomcat 6 server" Watch "Unable to access robots.txt file on tomcat 6 server" New topic
Author

Unable to access robots.txt file on tomcat 6 server

Tony Ghy
Greenhorn

Joined: Feb 12, 2011
Posts: 8
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

Joined: Jun 25, 2001
Posts: 16250
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Tony Ghy
Greenhorn

Joined: Feb 12, 2011
Posts: 8
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

Joined: Mar 22, 2000
Posts: 12825
    
    5
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

Joined: Feb 12, 2011
Posts: 8
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

Joined: Mar 22, 2000
Posts: 12825
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to access robots.txt file on tomcat 6 server