We use a custom 404 handler, so we looked at the template asked for 
(robots.txt) and, if that was what was called, cfincluded a robots.cfm 
that generated the output with a cfheader status 200 and a cfcontent 
type text/plain. Worked great, thanks for all the feedback.

Steve "Cutter" Blades
Adobe Certified Professional
Advanced Macromedia ColdFusion MX 7 Developer

Co-Author of "Learning Ext JS"
http://www.packtpub.com/learning-ext-js/book
_____________________________
http://blog.cutterscrossing.com

On 5/27/2009 11:20 AM, Andy Matthews wrote:
> The three saddest letters in the english language:
>
> IIS
>
> -----Original Message-----
> From: Barney Boisvert [mailto:[email protected]]
> Sent: Wednesday, May 27, 2009 11:18 AM
> To: cf-talk
> Subject: Re: Dynamic robots.txt
>
>
> Use mod_rewrite to rewrite robots.txt to robots.txt.cfm internally and have
> it generate whatever it needs.  We don't generate any robots.txt files
> dynamically, we generate several static versions (robots_something.txt,
> robots_or_other.txt, etc.), and then use mod_rewrite with RewriteCond
> checks to serve back the correct one for each request to robots.txt.  Doing
> dynamic generation would be just as easy, we just couldn't scale it
> sufficiently with that mechanism.
> Just ensure you return text/plain as your content type.
>
> cheers,
> barneyb
>
> On Wed, May 27, 2009 at 6:41 AM, Andy Matthews<[email protected]>
> wrote:
>> We have an application which delivers about 2000 websites. This is
>> really nice for lots of things, but not so nice for items such as
>> robots.txt where we might want unique values. Reviewing the spec for
>> robots.txt it requires that sitemap references be absolute paths
>> (while everything else can be root relative). As a hard coded file we
> obviously can't do this.
>> A coworker had the idea to "delete" our robots.txt file and use our
>> 404 handler to toss that request to ColdFusion, and write in the
>> absolute path to our sitemap each time the file is requested.
>>
>> 1) Can this be done reliably?
>> 2) Is anyone out there doing this already and could answer these
> questions?
>> Andy Matthews
>> Senior Web Developer
>>
>> www.dealerskins.com
>>
>> P Please consider the environment before printing this e-mail.
>>
>> Total customer satisfaction is my number 1 priority! If you are not
>> completely satisfied with the service I have provided, please let me
>> know right away so I can correct the problem, or notify my manager
>> Aaron West at [email protected].
>>
>>
>>
>>
>>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:322830
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to