Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Commit 3cbe191

Browse files
authored
Merge pull request #5255 from magento/ken-gh5237-robot-errors
Added Note for 404 error regarding /robots.txt files
2 parents f2ab048 + b63dd3e commit 3cbe191

File tree

1 file changed

+24
-20
lines changed

1 file changed

+24
-20
lines changed

guides/v2.2/cloud/trouble/robots-sitemap.md

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,43 +7,47 @@ functional_areas:
77
---
88
An attempt to generate and write the `sitemap.xml` file to the root directory results in the following error:
99

10-
```
10+
```terminal
1111
Please make sure that "/" is writable by the web-server.
1212
```
1313

1414
With {{site.data.var.ece}}, you can only write to specific directories, such as `var`, `pub/media`, `pub/static`, or `app/etc`. When you generate the `sitemap.xml` file using the Admin panel, you must specify the `/media/` path.
1515

16-
You do not have to generate a `robots.txt` because it generates on demand and stores the contents in the database. It does not create a file, but you can view the content in your browser with the url: `<domain.your.project>/robots.txt`
16+
You do not have to generate a `robots.txt` because it generates on demand and stores the contents in the database. It does not create a file, but you can view the content in your browser with the `<domain.your.project>/robots.txt` file.
1717

1818
This requires ECE-Tools version 2002.0.12 and later with an updated `.magento.app.yaml` file. See an example of these rules in the [magento-cloud repository](https://github.com/magento/magento-cloud/blob/master/.magento.app.yaml#L43-L49).
1919

20-
#### To generate a `sitemap.xml` file in version 2.2 and later:
20+
#### To generate a `sitemap.xml` file in version 2.2 and later
21+
22+
1. Access the Magento Admin panel.
23+
1. On the _Marketing_ menu, click **Site Map** in the _SEO & Search_ section.
24+
1. In the _Site Map_ view, click **Add Sitemap**.
25+
1. In the _New Site Map_ view, enter the following values:
2126

22-
1. Access the Magento Admin panel.
23-
1. On the _Marketing_ menu, click **Site Map** in the _SEO & Search_ section.
24-
1. In the _Site Map_ view, click **Add Sitemap**.
25-
1. In the _New Site Map_ view, enter the following values:
27+
- **Filename**:`sitemap.xml`
28+
- **Path**:`/media/`
2629

27-
- **Filename**:`sitemap.xml`
28-
- **Path**:`/media/`
30+
1. Click **Save & Generate**. The new site map becomes available in the _Site Map_ grid.
31+
1. Click the path in the _Link for Google_ column.
2932

30-
1. Click **Save & Generate**. The new site map becomes available in the _Site Map_ grid.
31-
1. Click the path in the `Link for Google` column.
33+
#### To add content to `robots.txt` file
3234

33-
#### To add content to `robots.txt` file:
35+
1. Access the Magento Admin panel.
36+
1. On the _Content_ menu, click **Configuration** in the _Design_ section.
37+
1. In the _Design Configuration_ view, click **Edit** for the website in the _Action_ column.
38+
1. In the _Main Website_ view, click **Search Engine Robots**.
39+
1. Make changes to the **Edit custom instruction of robots.txt** field.
40+
1. Click **Save Configuration**.
41+
1. Verify the `<domain.your.project>/robots.txt` file in your browser.
3442

35-
1. Access the Magento Admin panel.
36-
1. On the _Content_ menu, click **Configuration** in the _Design_ section.
37-
1. In the _Design Configuration_ view, click **Edit** for the website in the _Action_ column.
38-
1. In the _Main Website_ view, click **Search Engine Robots**.
39-
1. Make changes to the **Edit custom instruction of robots.txt** field.
40-
1. Click **Save Configuration**.
41-
1. Verify the file in your browser with the url: `<domain.your.project>/robots.txt`
43+
{:.bs-callout .bs-callout-info}
44+
If the `<domain.your.project>/robots.txt` file generates a `404 error`, [submit a Support ticket](https://support.magento.com/hc/en-us/articles/360019088251-Submit-a-support-ticket) to remove the redirect from `/robots.txt` to `/media/robots.txt`.
4245

4346
## Rewrite using Fastly VCL snippet
47+
4448
If you have different domains and you need separate site maps, you can create a VCL to route to the proper sitemap. Generate the `sitemap.xml` file in the Magento Admin panel as described above, then create a custom Fastly VCL snippet to manage the redirect. See [Custom Fastly VCL snippets]({{ page.baseurl }}/cloud/cdn/cloud-vcl-custom-snippets.html).
4549

46-
#### To use a Fastly VCL snippet for redirect:
50+
### To use a Fastly VCL snippet for redirect
4751

4852
Create a custom VCL snippet to rewrite the path for `sitemap.xml` to `/media/sitemap.xml` using the `type` and `content` key-value pairs.
4953

0 commit comments

Comments
 (0)