pi-hole / docs

The official Pi-hole documentation
https://docs.pi-hole.net/
Creative Commons Attribution Share Alike 4.0 International
201 stars 208 forks source link

Internal links not working without forward-slash in URL #440

Closed rosscg closed 3 years ago

rosscg commented 3 years ago

Platform

Tested on Safari and Chrome on Mac OSX

Expected behavior

Navigate to https://docs.pi-hole.net/guides/vpn/overview Click any link to another docs page View page

Actual behavior / bug

Navigate to https://docs.pi-hole.net/guides/vpn/overview Click any link to another docs page receive 404 error

Steps to reproduce

Use, for example: https://docs.pi-hole.net/guides/vpn/overview Instead of: https://docs.pi-hole.net/guides/vpn/overview/ (ie. omit final forward-slash) Click link at the end of first paragraph: "this section of the tutorial"

Additional context

Relevant as the failing URL is linked from external pages, for example: https://makezine.com/projects/raspberry-pi-network-ad-blocker/

PromoFaux commented 3 years ago

Ah-hah! I guess this is what you were trying to fix with #425 ?

rosscg commented 3 years ago

You got it ! Stumbled across the problematic page again so made sure to document it for you.

XhmikosR commented 3 years ago

If it's not https://github.com/datarobot/mkdocs-redirects to blame, it could be mkdocs (which I doubt though) or Netlify.

EDIT: maybe this is needed (untested) https://docs.netlify.com/routing/redirects/redirect-options/#trailing-slash EDIT2: GitHub pages didn't have this issue for sure, for what is worth

PromoFaux commented 3 years ago

Fixed by enabling Pretty URLs in the site settings. "Asset optimization" was disabled entirely, so have left the other rules as they were

image

XhmikosR commented 3 years ago

@PromoFaux the images setting is moot being that there's a GitHub Action here already which takes care of it.