You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/user-defined-redirects.rst
+46-10
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
User-defined Redirects
2
2
======================
3
3
4
-
You can set up redirects for a project in your project dashboard's Redirects page.
4
+
You can set up redirects for a project in your project dashboard's Redirects page.
5
5
6
6
Quick Summary
7
7
-------------
8
8
9
-
* Log into your Readthedocs.com Admin account.
9
+
* Log into your readthedocs.org account.
10
10
* From your dashboard, select the project on which you wish to add redirects.
11
11
* From the project's top navigation bar, select the Admin tab.
12
-
* From the left navigation menu, select Redirects.
12
+
* From the left navigation menu, select Redirects.
13
13
* In the form box "Redirect Type" select the type of redirect you want. See below for detail.
14
14
* Depending on the redirect type you select, enter FROM and/or TO URL as needed.
15
15
* When finished, click the SUBMIT Button.
@@ -18,6 +18,7 @@ Your redirects will be effective immediately.
18
18
19
19
Redirect Types
20
20
--------------
21
+
21
22
Prefix Redirects
22
23
~~~~~~~~~~~~~~~~
23
24
@@ -39,11 +40,19 @@ The example configuration would be::
39
40
40
41
Your users query would now redirect in the following manner::
41
42
42
-
docs.example.com/dev/install.html ->
43
-
docs.example.com/en/latest/install.html
43
+
docs.example.com/dev/install.html ->
44
+
docs.example.com/en/latest/install.html
44
45
45
46
Where ``en`` and ``latest`` are the default language and version values for your project.
46
47
48
+
49
+
.. note::
50
+
51
+
In other words, a *Prefix Redirect* removes a prefix from the original URL.
52
+
This prefix is removed from the rest of the URL's ``path`` after ``/$lang/$version``.
53
+
For example, if the URL is ``/es/1.0/guides/tutorial/install.html`` the "From URL's prefix" will be removed from ``/guides/tutorial/install.html`` part.
54
+
55
+
47
56
Page Redirects
48
57
~~~~~~~~~~~~~~
49
58
@@ -59,9 +68,15 @@ You would set the following configuration::
59
68
From URL: /example.html
60
69
To URL: /examples/intro.html
61
70
62
-
Note that the ``/`` at the start doesn't count the ``/en/latest``,
71
+
Note that the ``/`` at the start doesn't count the ``/en/latest``,
63
72
but just the user-controlled section of the URL.
64
73
74
+
.. tip::
75
+
76
+
*Page Redirects* can redirect URLs **outside** Read the Docs platform
77
+
just by defining the "To URL" as the absolute URL you want to redirect to.
78
+
79
+
65
80
Exact Redirects
66
81
~~~~~~~~~~~~~~~
67
82
@@ -81,20 +96,42 @@ The example configuration would be::
81
96
82
97
Your users query would now redirect in the following manner::
0 commit comments