Readthedocs.org: Page Redirects no longer work

Created on 18 Nov 2015  路  16Comments  路  Source: readthedocs/readthedocs.org

Page Redirects as documented here are no longer working.

For example, a redirect exists that maps /getting-started.html to /getting-started/overview.html. Visiting docs.smartthings.com/en/latest/getting-started.html does not redirect; it simply 404's.

Bug

Most helpful comment

I think the problem here (or at least part of it...) is that the slash at the beginning of the URL _is_ required. The 'Outcome' panel at the bottom of the form wrongly adds an extra slash, which will inevitably prompt users to correct it by removing the slash from their input fields:

screen shot 2016-09-19 at 14 27 31

(I notice @joschi's screenshot above is missing the leading slashes, which is probably why those redirects aren't working...)

All 16 comments

Exact Redirects don't seem to be working for me either.

:+1: - also does not work here for https://neos.readthedocs.org/

As our docs state, redirects only work on 404's. All of the pages listed above resolve, and so won't redirect.

http://docs.readthedocs.org/en/latest/user-defined-redirects.html#implementation

@ericholscher: In my case, the source page definitely does not exist. I get a 404 for http://docs.haskellstack.org/en/stable/faq.md, which should redirect to faq.html.

I have this redirect set up:

  • Page Redirect: /faq.md -> /faq.html

However, I noticed something interesting: http://docs.haskellstack.org/faq.md (note in the root) _does_ redirect to http://docs.haskellstack.org/en/stable/faq.html.

@ericholscher My pages don't exist either. Redirects that used to work no longer work.

For example:

  • Page Redirect: introduction/smartthings-architecture.html -> architecture/index.html
  • Page Redirect: introduction/groovy-the-smartthings-programming-language.html -> getting-started/groovy-basics.html
  • Page Redirect: smartapp-web-services-developers-guide/implementation.html -> smartapp-web-services-developers-guide/tutorial-part1.html

And we have many more redirects. These pages do not exist.

Prior to this issue being opened, these redirects worked correctly. Now they end up 404'd like this.

If there's something we can do to get this working again please let us know - we have a few top google hits that are now getting 404'd - not good.

Can this be re-opened?

If someone would like to submit some test cases that show this failing, it would be a great help, and move it up on our priority list of things to fix. https://github.com/rtfd/readthedocs.org/blob/master/readthedocs/rtd_tests/tests/test_redirects.py#L181 is the place to start looking.

It looks to me like test_redirect_keeps_version_number should already be testing this case, but it is passing. Here's something I don't understand: why does the test contain this fragment?

        with patch('readthedocs.core.views._serve_docs') as _serve_docs:
            _serve_docs.side_effect = Http404()

If I remove that fragment, I get this test failure:

rtd_tests/tests/test_redirects.py:239: in test_redirect_keeps_version_number
    self.assertEqual(r.status_code, 302)
E   AssertionError: 200 != 302

Why would it be returning a 200 status when the page doesn't exist, and why does the test have to force a 404?

Hi All,

I also have failing redirects, even when I get 404s. My question is what determines the 404? The current version of the docs being viewed, the stable or latest version? Others? The pages exist for some branches and not others as things move around.

FWIW, I experience the same problem on docs.graylog.org.

These are my configured rules:
Configured redirect rules

While http://docs.graylog.org/en/2.0/pages/users_roles.html does exist (and won't be redirected), http://docs.graylog.org/en/2.0/pages/foobar.html does not and should be redirected to http://docs.graylog.org/en/2.0/pages/users_and_roles.html if I understand the redirect feature correctly.

Unfortunately, readthedocs.org still delivers the 404 page:

$ curl -i http://docs.graylog.org/en/2.0/pages/foobar.html
HTTP/1.1 404 Not Found
Server: nginx/1.4.6 (Ubuntu)
Date: Tue, 26 Apr 2016 13:48:33 GMT
Content-Type: text/html
Content-Length: 177
Connection: keep-alive
Vary: Accept-Encoding
Set-Cookie: sessionid=h64oqdtwdts50rr6jyh8cn1i69kfllv0; Domain=readthedocs.org; expires=Tue, 10-May-2016 13:48:33 GMT; httponly; Max-Age=1209600; Path=/

<html>
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
<hr><center>nginx/1.4.6 (Ubuntu)</center>
</body>
</html>

I ended up working around this by including static HTML files that do meta refresh/javascript redirects, such as this one. I'm using mkdocs and include them in the extra_templates: section of mkdocs.yml (not sure how to do it with Sphinx). Would be much better if proper HTTP redirects worked, though.

I think the problem here (or at least part of it...) is that the slash at the beginning of the URL _is_ required. The 'Outcome' panel at the bottom of the form wrongly adds an extra slash, which will inevitably prompt users to correct it by removing the slash from their input fields:

screen shot 2016-09-19 at 14 27 31

(I notice @joschi's screenshot above is missing the leading slashes, which is probably why those redirects aren't working...)

Related to #2380 and there is a PR on progress #2711

Unless anyone has any information to suggest otherwise, I believe that #2380 fully accounts for the problems described here, and so this can be closed now that the fix (#3811) is merged.

@gasman thanks for following this! I think the same, this was the same problem as #2380. I'm closing this, if anyone is having this problem, feel free to ask to reopen this issue or create a new one with more information.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

humitos picture humitos  路  4Comments

pllim picture pllim  路  3Comments

cagataycali picture cagataycali  路  4Comments

humitos picture humitos  路  3Comments

SylvainCorlay picture SylvainCorlay  路  3Comments