I am creating an app using meteor that creates dynamic subdomain how meteor does like
example.meteor.com/
telescope.meteor.com/
example2.meteor.com/
Now i am willing to create sitemap and robots.txt for each url that is not given for meteor subdomain
example.meteor.com/sitemap.xml & example.meteor.com/robots.txt
telescope.meteor.com/sitemap.xml & telescope.meteor.com/robots.txt
example2.meteor.com/sitemap.xml & example2.meteor.com/robots.txt
I am using gadicohen:sitemaps for sitemap creation .
My problem-
I am able to get hostname using window.location.host . but how can i get it serverside to fetch subdomain .
Take a look at my comments in this thread:
I think the best way to achieve this would be by changing one line in the gadicohen:sitemaps library. You would just need to change line 67 of the sitemaps.js file from: pages = pages(); to pages = pages(req); I'd suggest opening a PR with this change (or cloning the package and making the change in your local code). Once this is in place the incoming request will then be available in the sitemaps.add function, and you can use it to toggle your URLs dynamically. For example: sitema…
Hi @hwillson , do you have any suggestions for robots.txt for subdomains? Since it’s the same codebase - I haven’t been able to figure this part out…