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

Mention that simple local webservers often don't handle 404s by default #95

Closed
jdillard opened this issue Jun 3, 2020 · 2 comments
Closed
Labels
Needed: documentation Documentation is required

Comments

@jdillard
Copy link
Contributor

jdillard commented Jun 3, 2020

I don't know if it is worth mentioning in the docs somewhere, but http.server (and other simple webservers I'm sure) don't have a default handler for 404 codes, so people might run into issues when attempting to test out the extension locally.

I also don't know if the docs would need to go this far, but here is an example of adding a custom request handler for 404 codes: https://stackoverflow.com/questions/22467908/python-simplehttpserver-404-page

@humitos
Copy link
Member

humitos commented Jun 4, 2020

Hi! Thanks for sharing this. It's interesting that you can add the handler to make it work locally without too much code.

I don't think the documentation needs to go too deep on this, but maybe worth to mention it in the FAQ. We do have a warning note saying that 404.html won't work properly locally: https://sphinx-notfound-page.readthedocs.io/en/latest/installation.html

Maybe we can link to a FAQ from that note, explain a little more there and link to the Stack Overflow solution?

@humitos humitos added the Needed: documentation Documentation is required label Jun 4, 2020
@jdillard
Copy link
Contributor Author

jdillard commented Jun 4, 2020

Doh, I did a bad job of putting on my "new user" hat and somehow clicked on every page but installation. If I had to guess, it was because the installation is pretty much documented in the README as well, so I decided to skip that page thinking I had already read that content. (For backstory, I happened to see someone else using the extension get confused by the lack of a 404, so I was attempting to be helpful.)

Adding it to the FAQ sounds like a good idea. I don't mind making a PR if you want. Maybe:

Why is my local webserver not showing a 404.html?
-------------------------------------------------

Simple webservers, such as ``http.server``, don't have a default handler for 404 codes, so it doesn't know to point to the generated ``404.html``.

To see an example of adding a custom request handler for 404 codes, see: https://stackoverflow.com/questions/22467908/python-simplehttpserver-404-page

And append to the installation warning:

If you can't see the 404.html file using a local simple webserver, it is most likely because they often don't support requests for 404 codes. Refer to the :doc:`faq` for more information.

humitos added a commit that referenced this issue Jul 23, 2020
Add warning about local web server for #95
@humitos humitos closed this as completed Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: documentation Documentation is required
Projects
None yet
Development

No branches or pull requests

2 participants