Skip to content
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

404 Page is not working properly #853

Closed
barreeeiroo opened this issue Aug 21, 2018 · 14 comments
Closed

404 Page is not working properly #853

barreeeiroo opened this issue Aug 21, 2018 · 14 comments
Labels
needs input Issue needs further input by the reporter

Comments

@barreeeiroo
Copy link

Description

When accessing to a non existing page, the 404 is broken sometimes

Expected behavior

It should render like this:
image

Actual behavior

It sometimes rendering like this:
image

Steps to reproduce the bug

  1. Go to https://docs2.makeroid.io/foo (working fine)
  2. Go to https://docs2.makeroid.io/foo/bar (broken)

Package versions

I'm using GitHub Pages, everything is on a public repo:
https://github.com/Makeroid/Documentation

Project configuration

Can be found here

System information

  • OS: GitHub Pages
@martinbira
Copy link
Sponsor Contributor

Just reproduced this myself.
Worth noting is that as above, https://docs2.makeroid.io/foo, this works, but just adding a trailing slash, https://docs2.makeroid.io/foo/ breaks the 404.

@barreeeiroo
Copy link
Author

If you check in gh-pages the 404.html file (as well as Console), it seems like it's using a relative path and not an absolute path, so maybe that can be issue

image

But how to fix it? 🤔

@squidfunk
Copy link
Owner

@squidfunk
Copy link
Owner

What version of MkDocs and Material are you using?

@barreeeiroo
Copy link
Author

These ones:

screenshot_2018-08-21-14-28-38-295_com android chrome

@squidfunk
Copy link
Owner

Could you try adding a slash at the end of your site_url?

@barreeeiroo
Copy link
Author

Still not working 😕

@barreeeiroo
Copy link
Author

It is supposed that this page should have an absolute path, such us /assets/etc instead of assets/etc, no?

https://github.com/Makeroid/Documentation/blob/gh-pages/404.html#L47

@squidfunk
Copy link
Owner

It actually must have an absolute path because it's a single HTML file that is located at the top of the document root. Relative paths would actually break it the exact way you are reporting because the relative path won't correctly resolve for subdirectories.

@squidfunk squidfunk added the needs input Issue needs further input by the reporter label Aug 21, 2018
@barreeeiroo
Copy link
Author

Even on localhost is broken, but what can be the cause of this issue?

@barreeeiroo
Copy link
Author

BTW, I'm getting several of these on the console, but MKDocs builds the site fine (except 404 page)
ERROR:root:Meta data not found: component
Maybe it can be releated to it (?)

@squidfunk
Copy link
Owner

I'm sorry, I'm out of ideas. It's perfectly working on the official docs. Maybe someone else experienced the same issue and fixed it?

@facelessuser
Copy link
Contributor

I believe this may be an upstream issue. When dealing with MkDocs issues, it is also helpful to check the MkDocs issues page: mkdocs/mkdocs#1598. Many issues at times are related to the actual MkDocs library and not to specific themes.

@barreeeiroo
Copy link
Author

I've found that this website has the same issue: http://elmahio.github.io/blog/notfound
I'll take a look to that MKDocs Issue 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs input Issue needs further input by the reporter
Projects
None yet
Development

No branches or pull requests

4 participants