1

What are the best ways to add the robots.txt file to adobe magento cloud environment

3 Answers 3

1

This is the solution from the Magento official document for Adobe Commerce on cloud infrastructure (Magento Cloud). You can take a look at it then you will know how to add robots.txt file.
To add content to the robots.txt file:

  1. Access the Admin.
  2. On the Content menu, click Configuration in the Design section.
  3. In the Design Configuration view, click Edit for the website in the Action column.
  4. In the Main Website view, click Search Engine Robots.
  5. Update the Edit custom instruction of robots.txt field.
  6. Click Save Configuration.
  7. Verify the <domain.your.project>/robots.txt file in your browser.

Note: If the <domain.your.project>/robots.txt file generates a 404 error, Submit an Adobe Commerce Support ticket to remove the redirect from /robots.txt to /media/robots.txt.

Source: https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/configure-store/robots-sitemap.html

2
  • Thanks. already checked but unable to add in admin its grey-out means in disabled mode. Commented Dec 29, 2022 at 12:58
  • You have to edit in Website or Default scope, it will allow you to edit ** Edit custom instruction of robots.txt File** Commented Dec 29, 2022 at 13:17
0

To add a robots.txt file to your Adobe Magento Cloud environment, you can follow these steps:

  1. Access your Magento Cloud account using the Cloud Platform interface.
  2. In the top navigation menu, click the "Projects" tab.
  3. Select the project that you want to add the robots.txt file to.
  4. In the left-hand navigation menu, click the "Code" tab.
  5. Under the "Code" tab, click the "Files" subtab.
  6. In the file tree, navigate to the root directory of your project.
  7. Click the "Add File" button in the top-right corner of the file tree.
  8. In the "Name" field, enter "robots.txt".
  9. In the "Content" field, enter the content that you want to include in your robots.txt file.
  10. Click the "Create File" button.

Alternatively, you can use a command-line interface (CLI) tool to add the robots.txt file to your project. To do this, you can use the magento-cloud CLI tool to connect to your Magento Cloud environment and push the robots.txt file to your project using Git.

  1. Install the magento-cloud CLI tool on your local machine.
  2. Connect to your Magento Cloud environment using the magento-cloud CLI tool.
  3. Create a robots.txt file in the root directory of your local project.
  4. Add the content that you want to include in your robots.txt file.
  5. Commit and push the robots.txt file to your Magento Cloud project using Git.

I hope this helps! Let me know if you have any questions.

1
  • Where can i find the Code Tab? Commented Dec 29, 2022 at 13:33
0

I found this official documentation useful.

https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/configure-store/robots-sitemap.html

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.