Just a quick question: I assume not, but can robots.txt be set within the template structure if index.php is being stripped, or does it have to be a physical file at the server root? Being able to pull it into EE would simplify the deploy process.
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
December 17, 2010 12:09am
Subscribe [3]#1 / Dec 17, 2010 12:09am
Just a quick question: I assume not, but can robots.txt be set within the template structure if index.php is being stripped, or does it have to be a physical file at the server root? Being able to pull it into EE would simplify the deploy process.
#2 / Dec 17, 2010 2:29am
A template wouldn’t be possible, but with a simple add-on it would. Newism does something similar with the NSM .htaccess Generator.
Greetz,
Wouter
#3 / Dec 17, 2010 9:10am
Hmm, not entirely sure what you’re getting at - do you mean use the .htaccess to add .txt onto a certain template?
The main reason for this is that I need to be able to specify an absolute URL to my sitemap.xml file in robots, and want to set this up as a default install so I don’t have to edit robots.txt every time.
#4 / Dec 17, 2010 9:24am
What I meant is that it is not possible with the default templating system as templates can’t exist outside the template folder.
You could however create a simple add-on that creates a robots.txt file upon installation which would generate the necessary rules and allow you to change them from the CP.
NSM .htaccess Generator does exactly the same thing, but for .htaccess files.
Greetz,
Wouter
#5 / Dec 17, 2010 9:26am
Ah, OK. That makes sense, but to be honest probably not worth the extra effort if that’s the only way of doing things - both add an extra step in the install process in any event!
Thanks for your help!
#6 / Dec 17, 2010 11:46am
Thanks for the assist, Wouter! Please post again in case there’s anything else.