Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

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

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

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

xaro93 opened this issue Feb 20, 2019 · 1 comment
Labels
Milestone

Comments

@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
Copy link
Member

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 as completed Mar 4, 2019
fabpot added a commit that referenced this issue Mar 4, 2019
…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
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants