You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: guides/v2.2/cloud/trouble/robots-sitemap.md
+24-20Lines changed: 24 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -7,43 +7,47 @@ functional_areas:
7
7
---
8
8
An attempt to generate and write the `sitemap.xml` file to the root directory results in the following error:
9
9
10
-
```
10
+
```terminal
11
11
Please make sure that "/" is writable by the web-server.
12
12
```
13
13
14
14
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.
15
15
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.
17
17
18
18
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).
19
19
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:
21
26
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/`
26
29
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.
29
32
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
32
34
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.
34
42
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`.
42
45
43
46
## Rewrite using Fastly VCL snippet
47
+
44
48
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).
45
49
46
-
####To use a Fastly VCL snippet for redirect:
50
+
### To use a Fastly VCL snippet for redirect
47
51
48
52
Create a custom VCL snippet to rewrite the path for `sitemap.xml` to `/media/sitemap.xml` using the `type` and `content` key-value pairs.
0 commit comments