Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
44 changes: 24 additions & 20 deletions guides/v2.2/cloud/trouble/robots-sitemap.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,43 +7,47 @@ functional_areas:
---
An attempt to generate and write the `sitemap.xml` file to the root directory results in the following error:

```
```terminal
Please make sure that "/" is writable by the web-server.
```

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.

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`
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.

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).

#### To generate a `sitemap.xml` file in version 2.2 and later:
#### To generate a `sitemap.xml` file in version 2.2 and later

1. Access the Magento Admin panel.
1. On the _Marketing_ menu, click **Site Map** in the _SEO & Search_ section.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume italicizing UI areas you don't click on is a cloud style thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when doing a search for "menu,", i found other references to menus (Marketing x3, Extension x2, Content x2, Account x2). Marketing and Content have the ital formatting, Account and Extension do not.

Copy link
Contributor

@meker12 meker12 Aug 23, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the style in Cloud, but I know that it is not consistently applied. In this topic, it is consistent. I think that it is potentially confusing not to have any formatting on UI element titles that are mentioned in the text of a procedure step.

Looking at our style guide, it seems that the only formatting we apply to UI elements is bold. When I first started, I remember reading about using italics to reference UI element names, but I don't see that anywhere now.

Checking out the Google style guide, they bold all UI element mentions whether they are referenced by title, or referenced as a clickable element. https://developers.google.com/style/ui-elements

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There has been much discussion about what to do here. It's ongoing... I just wish we were consisten across repos/doc sets!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving menu titles in ital for this topic

1. In the _Site Map_ view, click **Add Sitemap**.
1. In the _New Site Map_ view, enter the following values:

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

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

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

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

1. Access the Magento Admin panel.
1. On the _Content_ menu, click **Configuration** in the _Design_ section.
1. In the _Design Configuration_ view, click **Edit** for the website in the _Action_ column.
1. In the _Main Website_ view, click **Search Engine Robots**.
1. Make changes to the **Edit custom instruction of robots.txt** field.
1. Click **Save Configuration**.
1. Verify the file in your browser with the url: `<domain.your.project>/robots.txt`
{:.bs-callout .bs-callout-info}
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`.

## Rewrite using Fastly VCL snippet

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).

#### To use a Fastly VCL snippet for redirect:
### To use a Fastly VCL snippet for redirect

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

Expand Down