apify-docs icon indicating copy to clipboard operation
apify-docs copied to clipboard

docs.apify.com/sdk/ returns 404, docs.apify.com/sdk returns 200

Open honzajavorek opened this issue 1 year ago • 2 comments

When working on https://github.com/apify/apify-docs/pull/1101 I found that:

  • curl -I https://docs.apify.com/sdk returns HTTP 200
  • curl -I https://docs.apify.com/sdk/ returns HTTP 404

I don't experience any issues in the browser, but link checks and possibly other tooling see the difference. I'd expect redirect, but not 404.

honzajavorek avatar Jul 19 '24 12:07 honzajavorek

Duplicate of #520, its not that simple as you might think, and boils down to how docusaurus handles the trailing slash and the fact that there are more instances routes to the same domain.

B4nan avatar Jul 24 '24 09:07 B4nan

Oh wait, this is a bit different, you are talking about the new SDK landing page. But still, this is how docusaurus handles it I am afraid (and it is the case for every single "content" page, not just for the /sdk one), we set it up so there are no trailing slashes (with the exception of the child docusaurus instances, like https://docs.apify.com/sdk/js/ but we have 302 redirects there for the variant without trailing slash).

Maybe we could try to set the redirects up on nginx level, but it feels a bit scary since there are exceptions in the opposite direction (you want a redirect from /sdk/ to /sdk, but at the same time you want the opposite for /sdk/js, but again, not for anything nested like /sdk/js/docs). I'll leave this open.

B4nan avatar Jul 24 '24 09:07 B4nan