Skip to content

How do exact redirects interact with other redirects? #9988

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
astrojuanlu opened this issue Feb 6, 2023 · 7 comments
Closed

How do exact redirects interact with other redirects? #9988

astrojuanlu opened this issue Feb 6, 2023 · 7 comments
Labels
Needed: documentation Documentation is required Support Support question

Comments

@astrojuanlu
Copy link
Contributor

Details

We have some questions about redirects - I was hesitant whether to send a private support request (as encouraged by the issue form), but since one could consider this a documentation bug, I went ahead and opened an issue instead.

Comes from https://stackoverflow.com/q/75321853/554319, opened by my colleague @stichbury

I currently have docs on RTD (and have had them there for 3 years). We have moved pages around as versions changed, so have a set of about a hundred exact redirects, something like this:

/en/stable/introduction/intro.html -> /en/stable/introduction/setup-guide.html

Now I have a custom domain and want to point everything with a canonical link over there.

What will happen to those redirects? Are they applied first so someone with a bookmark to intro.html is pointed to setup-guide.html over on project.readthedocs.io and then the redirect to myprojectname.com/docs/ applied?

That is, will this happen?

/en/stable/introduction/intro.html --> myprojectname.com/docs/en/stable/introduction/setup-guide.html

Basically we're too scared we'll break the whole edifice and end world order.

@humitos
Copy link
Member

humitos commented Feb 6, 2023

This is a good question.

I'll have to double check with the code, but I'd say that people will be redirected twice:

  1. project.readthedocs.io/path/ -> custom domain/path/
  2. /path/ -> /new-path/

First redirect is called "system redirect" in the source code and the second one "user redirect"

@ANA885874
Copy link

Ok

@humitos
Copy link
Member

humitos commented Feb 13, 2023

I found a project in a similar state to what you described and ran a small test. It seems my theory was correct:

▶ curl -IL https://civicactions-handbook.readthedocs.io/en/latest/04-how-we-work/agile-practices/template/
HTTP/2 302 
date: Mon, 13 Feb 2023 10:20:57 GMT
content-type: text/html; charset=utf-8
content-length: 0
location: https://guidebook.civicactions.com/en/latest/04-how-we-work/agile-practices/template/
x-rtd-redirect: canonical-cname
x-rtd-domain: civicactions-handbook.readthedocs.io
x-rtd-project: civicactions-handbook
x-rtd-version: latest
x-rtd-project-method: subdomain
x-rtd-version-method: path
strict-transport-security: max-age=31536000; includeSubDomains; preload
referrer-policy: no-referrer-when-downgrade
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
vary: Accept-Language, Cookie
content-language: en
x-served: Django-Proxito
x-backend: web-i-0e412ebb03a01c338
cf-cache-status: HIT
age: 25
expires: Mon, 13 Feb 2023 10:40:57 GMT
cache-control: public, max-age=1200
server: cloudflare
cf-ray: 798cd59dbe0628de-BCN
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

HTTP/2 302 
date: Mon, 13 Feb 2023 10:20:58 GMT
content-type: text/html; charset=utf-8
content-length: 0
location: https://guidebook.civicactions.com/en/latest/practice-areas/project-management/templates/
x-rtd-redirect: user
x-rtd-domain: guidebook.civicactions.com
x-rtd-project: civicactions-handbook
x-rtd-version: latest
x-rtd-project-method: cname
x-rtd-version-method: path
referrer-policy: no-referrer-when-downgrade
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
vary: Accept-Language, Cookie
content-language: en
x-served: Proxito-404
x-backend: web-i-068afd8a5914c2450
cf-cache-status: HIT
age: 79
expires: Mon, 13 Feb 2023 10:40:58 GMT
cache-control: public, max-age=1200
server: cloudflare
cf-ray: 798cd5a02ad028de-BCN
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

HTTP/2 200 
date: Mon, 13 Feb 2023 10:20:58 GMT
content-type: text/html
vary: Accept-Encoding
x-amz-id-2: uYGGqjrxLza1DEGgFDrzJXFrnwGA4J62IcPHRSA1/SY1qM2Lr2bULX2CXgIrz7pNtzLzwghZb6Q=
x-amz-request-id: ENC9ZGK9RWGN304V
last-modified: Wed, 08 Feb 2023 16:45:38 GMT
etag: W/"df69f7550e2a5c0c6a5df597fbe5dcc0"
x-amz-server-side-encryption: AES256
x-served: Nginx-Proxito-Sendfile
x-backend: web-i-0c47dadd065d2106a
x-rtd-project: civicactions-handbook
x-rtd-version: latest
x-rtd-path: /proxito/html/civicactions-handbook/latest/practice-areas/project-management/templates/index.html
x-rtd-domain: guidebook.civicactions.com
x-rtd-version-method: path
x-rtd-project-method: cname
referrer-policy: no-referrer-when-downgrade
cf-cache-status: HIT
age: 79
expires: Mon, 13 Feb 2023 10:40:58 GMT
cache-control: public, max-age=1200
server: cloudflare
cf-ray: 798cd5a04b2328de-BCN
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400

Is this helpful for you? Does it work as you want?

@humitos humitos added the Needed: documentation Documentation is required label Feb 13, 2023
@astrojuanlu
Copy link
Contributor Author

Thanks a lot! This is really helpful. I think the conclusion is that adding a custom domain redirect should not break anything 😄 and in any case, seems like something that can be easily rolled back if the world crumbles.

cc @tynandebold @stichbury

Closing this for now!

@stichbury
Copy link

Thanks @humitos and @astrojuanlu -- That's good to know and I think we have to take a deep breath and try it. I appreciate the ⭐ ⭐ ⭐ ⭐ ⭐ help! Thanks again.

@astrojuanlu
Copy link
Contributor Author

FTR, we launched today docs.kedro.org and everything worked like a charm 💯

@humitos
Copy link
Member

humitos commented Mar 7, 2023

That's excellent news! Thanks for the feedback and sharing it back here 💪🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: documentation Documentation is required Support Support question
Projects
None yet
Development

No branches or pull requests

4 participants