What are the best ways to add the robots.txt file to adobe magento cloud environment
3 Answers
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:
- Access the Admin.
- On the Content menu, click Configuration in the Design section.
- In the Design Configuration view, click Edit for the website in the Action column.
- In the Main Website view, click Search Engine Robots.
- Update the Edit custom instruction of robots.txt field.
- Click Save Configuration.
- 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.
- Thanks. already checked but unable to add in admin its grey-out means in disabled mode.Mohamed Abbas– Mohamed Abbas2022-12-29 12:58:00 +00:00Commented 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**Tu Van– Tu Van2022-12-29 13:17:33 +00:00Commented Dec 29, 2022 at 13:17
To add a robots.txt file to your Adobe Magento Cloud environment, you can follow these steps:
- Access your Magento Cloud account using the Cloud Platform interface.
- In the top navigation menu, click the "Projects" tab.
- Select the project that you want to add the robots.txt file to.
- In the left-hand navigation menu, click the "Code" tab.
- Under the "Code" tab, click the "Files" subtab.
- In the file tree, navigate to the root directory of your project.
- Click the "Add File" button in the top-right corner of the file tree.
- In the "Name" field, enter "robots.txt".
- In the "Content" field, enter the content that you want to include in your robots.txt file.
- 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.
- Install the magento-cloud CLI tool on your local machine.
- Connect to your Magento Cloud environment using the magento-cloud CLI tool.
- Create a robots.txt file in the root directory of your local project.
- Add the content that you want to include in your robots.txt file.
- 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.
- Where can i find the Code Tab?Mohamed Abbas– Mohamed Abbas2022-12-29 13:33:35 +00:00Commented Dec 29, 2022 at 13:33
I found this official documentation useful.