Adding robots.tx and a sitemap

Hello -

I host a Dash app on a subdomain of my website for my users to interactively explore community survey data. From what I can tell, search engines treat sub domain’s as their own unique domain. So, I would like to have a robots.txt and a sitemap.xml file available for the craweler.

How can I accomplish this?

Would you recommend hosting the app at instead of


Is this possible? I haven’t been able to figure it out.

@cmwetherell aware it’s been a while but don’t suppose you found an answer to this question?

Hello @matt-buckley,

I think I’d honestly just use a Flask template and route to return the info that you want to display.

1 Like

This is how I did it, although it’s a bit late answer, I just want to put the solution here, just in case.

from flask import send_from_directory

def send_sitemap():
    return send_from_directory("assets", "sitemap.xml")

def send_robots():
    return send_from_directory("assets", "robots.txt")