How to update/replace robots.txt file in aws cloudfront?

by kyleigh.wolff , in category: SEO , 7 months ago

How to update/replace robots.txt file in aws cloudfront?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer


by pietro , 7 months ago


To update or replace the robots.txt file in AWS CloudFront, you need to follow these steps:

  1. Sign in to the AWS Management Console and open the CloudFront console.
  2. Click on the Distribution tab and select the relevant distribution from the list.
  3. Go to the Behaviors tab and select the behavior for which you want to update the robots.txt file.
  4. Click on the Edit button next to Default(*) or create a new behavior if needed.
  5. In the Edit Behavior dialog, scroll down to the Cache and origin requests section.
  6. Under "Cache behavior settings", click on "Forward all query strings" or "Forward none (Caching Disabled)" based on your requirement.
  7. Go to the Whitelist query string tab and click on "Choose Whitelist Query String" in the "Option" drop-down menu.
  8. In the one query string per line field, enter ?robots.txt and click on Add.
  9. Click on the Create button to save the changes.
  10. The new settings will be applied to the CloudFront distribution, and the robots.txt file should now be updated or replaced.

Note: Keep in mind that it may take a few minutes for the changes to propagate across the CloudFront network.