Skip to content

How do I get readthedocs to use a custom 404 page? #5050

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
sg-s opened this issue Dec 31, 2018 · 8 comments
Closed

How do I get readthedocs to use a custom 404 page? #5050

sg-s opened this issue Dec 31, 2018 · 8 comments
Labels
Improvement Minor improvement to code

Comments

@sg-s
Copy link

sg-s commented Dec 31, 2018

Details

Expected Result

If I go to https://xolotl.readthedocs.io/en/master/fsdf, I expect to see the 404 page that is part of my theme (which is what I see when I build locally)

Actual Result

Instead, I get the default readthedocs 404 page with the maze.

I don't understand why the 404.html that is built as part of my theme isn't being used.

I can't find any setting in readthedocs that specifies custom 404 pages

I've looked at these links, and I don't think they help:

Any help appreciated!

@humitos
Copy link
Member

humitos commented Jan 2, 2019

Hi @sg-s and thanks for your report.

Currently, this is not possible.

There are more discussion around this and the problems of different implementations at #353 (actually, it feels this issue is a duplicated of that one)

@humitos humitos added the Improvement Minor improvement to code label Jan 2, 2019
@sg-s
Copy link
Author

sg-s commented Jan 2, 2019

@humitos thanks -- for clarification, i am using the material theme, and i note that in the docs for that theme, they have a functional 404 page:

https://squidfunk.github.io/mkdocs-material/dsf

is this because they're not using readthedocs, and instead hosting on github?

@humitos
Copy link
Member

humitos commented Jan 2, 2019

is this because they're not using readthedocs, and instead hosting on github?

I suppose, yes.

I hope RTD support this soon. It's something that I've wanting for some time.

I'm closing this issue here. Please, subscribe to the one that I linked here since all the discussion will happen there mostly.

Thanks!

@humitos
Copy link
Member

humitos commented May 29, 2019

@sg-s hey! we do support custom 404 pages now!

Your project now shows your custom page at: https://xolotl.readthedocs.io/en/master/notfound

The only thing missing is fixing the resources (css, js, images, etc) to use absolute URLs so they are found by the browser properly.

@sg-s
Copy link
Author

sg-s commented Jun 4, 2019

@humitos Thanks! Could you elaborate a little? Which resources do I fix? Do I need a redirect?

@stsewd
Copy link
Member

stsewd commented Jun 4, 2019

@sg-s all links to css/js are relative, those should be absolute. Since the 404 page can be displayed in any subpage /foo/bar/404.thml not just in /404.hml

@sg-s
Copy link
Author

sg-s commented Jun 4, 2019

Great, thanks. Sounds like I need to modify the theme I'm using and replace all relative links with absolute links

@humitos
Copy link
Member

humitos commented Jun 5, 2019

@sg-s let us know if after changing the links it does work! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

3 participants