Remove robots.txt

Google’s documentation says:

> robots.txt is not a mechanism for keeping a web page out of Google. To
> keep a web page out of Google, you should use noindex directives

We’ve implemented a noindex directive now, so we don’t need to serve
robots.txt any more.
This commit is contained in:
Chris Hill-Scott
2020-05-26 17:47:43 +01:00
parent f902205ef3
commit f12f0fae87
3 changed files with 2 additions and 27 deletions

View File

@@ -36,17 +36,6 @@ def index():
)
@main.route('/robots.txt')
def robots():
return (
'User-agent: *\n'
'Disallow: /sign-in\n'
'Disallow: /support\n'
'Disallow: /support/\n'
'Disallow: /register\n'
), 200, {'Content-Type': 'text/plain'}
@main.route('/error/<int:status_code>')
def error(status_code):
if status_code >= 500:

View File

@@ -256,7 +256,6 @@ class HeaderNavigation(Navigation):
'returned_letters',
'returned_letters_report',
'revoke_api_key',
'robots',
'send_messages',
'send_notification',
'send_one_off',
@@ -608,7 +607,6 @@ class MainNavigation(Navigation):
'returned_letters_report',
'revalidate_email_sent',
'roadmap',
'robots',
'security',
'send_notification',
'send_from_contact_list',
@@ -870,7 +868,6 @@ class CaseworkNavigation(Navigation):
'revalidate_email_sent',
'revoke_api_key',
'roadmap',
'robots',
'security',
'send_messages',
'send_notification',
@@ -1163,7 +1160,6 @@ class OrgNavigation(Navigation):
'revalidate_email_sent',
'revoke_api_key',
'roadmap',
'robots',
'security',
'send_messages',
'send_notification',

View File

@@ -63,18 +63,8 @@ def test_logged_in_user_redirects_to_choose_account(
)
def test_robots(client):
assert url_for('main.robots') == '/robots.txt'
response = client.get(url_for('main.robots'))
assert response.headers['Content-Type'] == 'text/plain'
assert response.status_code == 200
assert response.get_data(as_text=True) == (
'User-agent: *\n'
'Disallow: /sign-in\n'
'Disallow: /support\n'
'Disallow: /support/\n'
'Disallow: /register\n'
)
def test_robots(client_request):
client_request.get_url('/robots.txt', _expected_status=404)
@pytest.mark.parametrize('endpoint, kwargs', (