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

beep boop: robots.txt #87

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions uipa_org/templates/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Hello, this is not the robots.txt file you are looking for.

User-agent: *
Disallow: /account/*
Disallow: /admin/*
Disallow: /uipa-admin/*

# __ __ __ .______ ___
# | | | | | | | _ \ / \
# | | | | | | | |_) | / ^ \
# | | | | | | | ___/ / /_\ \
# | `--' | | | | | / _____ \
# \______/ |__| | _| /__/ \__\

8 changes: 8 additions & 0 deletions uipa_org/theme/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from django.contrib.sitemaps import views as sitemaps_views
from django.contrib.flatpages.views import flatpage
from django.utils.translation import gettext
from django.views.generic.base import TemplateView

from froide.urls import (
admin_urls,
Expand Down Expand Up @@ -61,6 +62,13 @@
# Redirect /help and /about to /help/faq
re_path(r'^%s/$' % gettext('help'), flatpage, {'url': '/help/faq/'}, name='help'),
re_path(r'^%s/$' % gettext('about'), flatpage, {'url': '/help/faq/'}, name='about'),

# Beep boop, robots.txt
re_path(
"robots.txt",
TemplateView.as_view(template_name="robots.txt", content_type="text/plain"),
),

# Base case: Redirect all other requests to the index view
re_path('', index, name='index'),
]