Skip to content

Commit cce728e

Browse files
committed
Cloud: robots.txt and basic auth
1 parent f1e994e commit cce728e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/cloud/domains.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ To find your preview domain, click the globe icon next to any environment in the
1818
Changing the handle of a project or environment may take a moment to update in our routing layer. If you have other services that rely on a consistent hostname (say, for the delivery of webhooks), consider temporarily pointing a [subdomain](#subdomains) at the environment.
1919
:::
2020

21+
We automatically inject a `robots.txt` for preview domains (and non-production [environments](environments.md)) that disallows all crawling. If you want to prevent regular users from accessing your site’s front-end, consider using [basic HTTP authentication](/5.x/reference/config/app.md#basic-authentication).
22+
2123
## Adding a Domain
2224

2325
In your Cloud project, navigate to **Domains**, then click **New domain**.

docs/cloud/environments.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@ Craft Console uses the production environment’s preview domain (or a custom do
7070

7171
### robots.txt
7272

73-
For any environment that is not marked as production, Craft Cloud will serve requests to `robots.txt` with this body:
73+
For any environment that is not marked as production, Cloud injects a `robots.txt` with this body, to prevent indexing:
7474

7575
```
7676
User-agent: *
7777
Disallow: /
7878
```
79-
80-
So they don’t get indexed by search engines. Production environments will allow the application to dictate the contents of `robots.txt`.
79+
Production environments allow the application to dictate the contents of `robots.txt`. This is typically handled by creating `templates/robots.txt.twig` and populating it with static text, or using a plugin like [SEOMatic](plugin:seomatic) that expose an editing interface in the control panel.
8180

8281
## Deleting an Environment
8382

0 commit comments

Comments
 (0)