Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add X-Robots-Tag in header of response in dev mode #30318

Closed
xaro93 opened this Issue Feb 20, 2019 · 1 comment

Comments

Projects
None yet
3 participants
@xaro93
Copy link

xaro93 commented Feb 20, 2019

Description
For security, you can automatically add the X-Robots-Tag: noindex header in developer mode. Sometimes it happens that someone will make such a website available on the Internet. I think it would be better for search engines to not index such websites.

Robots meta tag and X-Robots-Tag HTTP header specifications

@javiereguiluz

This comment has been minimized.

Copy link
Member

javiereguiluz commented Feb 20, 2019

I like this proposal a lot!

We already include <meta name="robots" content="noindex,nofollow" /> for anything related to the profiler ... but I think it makes sense to add X-Robots-Tag: noindex, nofollow to the entire site if it's being run in dev environment. Anyone see any potential drawback?

@javiereguiluz javiereguiluz added this to the next milestone Feb 20, 2019

@fabpot fabpot closed this Mar 4, 2019

fabpot added a commit that referenced this issue Mar 4, 2019

feature #30325 [HttpKernel] Prevent search engines from indexing dev …
…applications (GaryPEGEOT)

This PR was squashed before being merged into the 4.3-dev branch (closes #30325).

Discussion
----------

[HttpKernel] Prevent search engines from indexing dev applications

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #30318
| License       | MIT
| Doc PR        | TODO

Add the *X-Robots-Tag: noindex* to dev (and test) applications to prevent search engines to index them.

Commits
-------

3dd8671 [HttpKernel] Prevent search engines from indexing dev applications
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.