Skip to main content
Level 6
Aug 24, 2022 11:07 AM UTC
Solved

Prevent Robots.txt file from getting downloaded

My robots.txt file is added to content/dam and I have added rewrite rules for the same in my dispatcher. I have update the robots.txt path in Content Disposition under exclude path. Yet, the the robots file gets downloaded instead of showing in browser. 

 

In disposition config: if i add entire path tille robots.txt, it fails to load on browser. If i add /content/dam*:text/plan, it works.

But the above will block all text type file. So i made change in dispatcher rewrite rule file:

<LocationMatch "/content/dam/site/robots.txt">
ForceType text/plain
Header set Content-Disposition inline
</LocationMatch>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Sachin_Arora_
Sachin_Arora_Accepted solution
Community Advisor
Aug 24, 2022 1:56 PM UTC

The issue looks like more of browser cache. I followed the same and it works fine after clearing the cache.

Please clean browser cache or try in different browser.

Screenshot of configuration working fine for me.

 

 

4 replies

Sachin_Arora_
Community Advisor
Sachin_Arora_Community AdvisorAccepted solution
Community Advisor
Aug 24, 2022 1:56 PM UTC

The issue looks like more of browser cache. I followed the same and it works fine after clearing the cache.

Please clean browser cache or try in different browser.

Screenshot of configuration working fine for me.

 

 

Translate
BrianKasingli
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Aug 24, 2022 4:15 PM UTC

Robots.txt, are you using https://adobe-consulting-services.github.io/acs-aem-commons/features/robots-txt/index.html or your own custom servlet?

Translate
Level 6
Aug 25, 2022 4:14 AM UTC

we are not using custom servlet.

Translate
BrianKasingli
Adobe Champion and Community Advisor
Adobe Champion and Community Advisor
Aug 25, 2022 4:59 AM UTC