Platform.sh is now Upsun. Click here to learn more
Upsun User Documentation

Manage search indexing for an environment

Try Upsun for 15 days
After that, enjoy the same game-changing Upsun features for less with the First Project Incentive!¹ A monthly $19 perk!
Activate your 15-day trial
¹Terms and conditions apply

When you have preview environments, you don’t want search engines indexing them and diluting the SEO of your production site.

Search engine indexers are told to ignore all preview environments. When you’re ready to go live, give your production environment a custom domain and then set it to be visible to search engines.

To change your production environment’s visibility to search engines, follow these steps:

To not restrict indexers on your production environment, run the following command:

upsun environment:info --environment PRODUCTION_ENVIRONMENT_NAME restrict_robots false
  1. Select a project.
  2. From the Environment menu, select the production environment.
  3. Click Settings near the upper right of the page.
  4. On the General tab, select or clear the Hide from search engines checkbox.

Upsun can’t guarantee that indexers follow the instructions. If you’re concerned about access, set up HTTP access control.

How it’s done Anchor to this heading

When Hide from search engines is enabled, search engines are turned away from environments by including a X-Robots-Tag header:

X-Robots-Tag: noindex, nofollow

This header instructs search engine indexers to not index these sites and not traverse links from these sites, keeping non-production sites out of search engine indexes.

By default, this setting is enabled for all upsun.site domains, and is disabled for production environments with a custom domain.

Alternative method Anchor to this heading

You can also instruct search engine indexers by using a robots.txt file. Your app can serve this as a static file from its disk or as a dynamic response from its passthru. Control either with the location section of your app configuration.

If your robots.txt file includes instructions to ignore a page, search engine indexers may ignore it even if you have configured Upsun to not send the header.