diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index ab145a5c3..5d9f03aa1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,7 +4,7 @@ How to contribute
This guide is under heavy development. If you would like to contribute, please
see:
-http://docs.python-guide.org/en/latest/notes/contribute/
+https://docs.python-guide.org/notes/contribute/
How to test your changes
------------------------
@@ -34,4 +34,4 @@ Style Guide
For all contributions, please follow the `Guide Style Guide`:
-http://docs.python-guide.org/en/latest/notes/styleguide/
+https://docs.python-guide.org/notes/styleguide/
diff --git a/Readme.rst b/Readme.rst
index 8dce3c079..d7d26dfb1 100644
--- a/Readme.rst
+++ b/Readme.rst
@@ -33,4 +33,4 @@ Topics include:
If you aren't fond of reading reStructuredText, there is an
almost up-to-date `HTML version at docs.python-guide.org
-`_.
+`_.
diff --git a/docs/404.rst b/docs/404.rst
index 4398775bc..1cb26757c 100644
--- a/docs/404.rst
+++ b/docs/404.rst
@@ -8,9 +8,9 @@ It looks like this was the result of either:
- a mistyped address
- an out-of-date link
-`Click here to go back to the homepage. `_
+`Click here to go back to the homepage. `_
-Or, try `searching `_.
+Or, try `searching `_.
.. raw:: html
diff --git a/docs/Makefile b/docs/Makefile
index 40b479e94..3b85476dd 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -59,6 +59,12 @@ dirhtml:
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+netlify: dirhtml
+ @cp $(BUILDDIR)/dirhtml/404/index.html $(BUILDDIR)/dirhtml/404.html
+ @sed -i -e 's/src="..\//src="\//g' $(BUILDDIR)/dirhtml/404.html
+ @sed -i -e 's/href="..\//href="\//g' $(BUILDDIR)/dirhtml/404.html
+ @cp _extra/* $(BUILDDIR)/dirhtml/
+
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
diff --git a/docs/_extra/_redirects b/docs/_extra/_redirects
new file mode 100644
index 000000000..29712f048
--- /dev/null
+++ b/docs/_extra/_redirects
@@ -0,0 +1,16 @@
+# Redirect rules
+# Docs: https://www.netlify.com/docs/redirects/
+
+# Redirect http to https (avoid one extra hop with an explicit rule for /en/latest/)
+http://docs.python-guide.org/en/latest/* https://docs.python-guide.org/:splat 301!
+http://docs.python-guide.org/* https://docs.python-guide.org/:splat 301!
+
+# Redirect RTD prefix to /
+/en/latest/* /:splat 301!
+
+# Redirect domain aliases to primary domain
+http://python-guide.org/* http://docs.python-guide.org/:splat 301!
+https://python-guide.org/* https://docs.python-guide.org/:splat 301!
+
+# Redirect Netlify version to primary domain
+https://python-guide.netlify.com/* https://docs.python-guide.org/:splat 301!
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
index 93dd11ecd..2e7538979 100644
--- a/docs/_templates/layout.html
+++ b/docs/_templates/layout.html
@@ -1,6 +1,39 @@
{% extends "!layout.html" %}
{%- block extrahead %}
- {{ super() }}
+ {# No super() because we want to avoid loading an empty custom.css file #}
+
+ {# #}
+
+
+
+
+ {% if pagename == 'index' %}
+
+ {% elif pagename == '404' %}
+ {# No canonical on our 404 template. #}
+ {% else %}
+
+ {% endif %}
+
+
+
+
+ {# Alabaster theme native GA integration is outdated (ga.js). #}
+ {# Insert our own GA snippet instead. #}
+
{% endblock %}
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index ebe19b3df..74e3afabf 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -13,8 +13,7 @@
Stay Informed
Receive updates on new releases and upcoming projects.
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index dadc299e9..06f20dde4 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -62,7 +62,7 @@ using your OS package manager, you may have to `install pip