Skip to content
This repository has been archived by the owner on Aug 8, 2019. It is now read-only.

Redirect topics outside "doc" category to the forum (instead of 404) #145

Closed
degville opened this issue May 3, 2019 · 4 comments · Fixed by #152
Closed

Redirect topics outside "doc" category to the forum (instead of 404) #145

degville opened this issue May 3, 2019 · 4 comments · Fixed by #152

Comments

@degville
Copy link
Contributor

degville commented May 3, 2019

A 404 error is currently returned when there's a link that's either a) outside of the docs category, or b) in the docs category but not in the sitemap. This isn't very reader or forum-user friendly.

We can (and will) edit the forum posts to fix this, and add instructions to the guidelines for contributors, but I also think it's worth defaulting to the forum topic URL instead of a 404.

eg. https://forum.snapcraft.io/t/10624 instead of https://docs.snapcraft.io/t/10624 (which returns a 404).

This will help when someone edits a published docs page with a forum link outside of the published docs, creating a non-obvious 404 when the page is updated.

@nottrobin
Copy link
Contributor

nottrobin commented May 7, 2019

@degville: b) in the docs category but not in the sitemap

I don't think this is accurate. E.g., see https://docs.snapcraft.io/t/new-docs-snapcraft-io-publishing-process/11202. This is not in the sitemap, but shows up just fine.

However, this URL is not pretty, and every page in the docs category that is used in the site at all should be given a pretty URL by adding it to the sitemap ASAP. If we end up with a lot of URLs looking like the one above, we'll probably have to lock it down by making such URLs 404.

@degville: a) outside of the docs category

This was deliberately changed, quite recently, in #123 - my memory is that this was at your request @degville. We used to simply allow any forum topic to be displayed in the docs site if you craft the URL, but we deliberately turned that off because it was felt that it was potentially open to abuse or misleading for users.

At the moment, the best way to link to topics that are outside the "doc" category is to use an absolute URL rather than a relative one to link to the forum - e.g.:

For more info [go here](https://forum.snapcraft.io/t/10624)

That way the link will always take the user to the forum post instead of a 404 on the docs site.

However, if you're sure you want this behaviour changed, that's fine. My suggestion would be that for any topics that are outside the "doc" category, we redirect the user to forum.snapcraft.io instead of displaying the post in the docs site itself. However, when I suggested this I don't think @niemeyer was keen on the idea (again, if memory serves correctly).

@niemeyer
Copy link

niemeyer commented May 7, 2019

We should probably hold a quick meeting to discuss this, as i.t doesn't sound like we're aligned or even representing each other's point entirely correctly. For example, @degville says that sites which are included in the docs category are also returning 404s, which is unexpected. I also understand he's saying that any links which are in the forum but outside the docs category return a 404 instead of a link to the forum. This feels like a poor way to handle it.. we may not want people linking to arbitrary content in the forum, but even if that's the case, finding out that this is the case by people reporting 404s seems pretty bad.

Can we please have a meeting with at least the three of us so we can sync?

@nottrobin
Copy link
Contributor

Yep good idea, I'll schedule that in.

@nottrobin
Copy link
Contributor

We agreed in the meeting that if a URL for a topic not in the "doc" category is requested, we should send a 302 to redirect the user to the forum.

@nottrobin nottrobin changed the title 404 from docs.snapcraft.io when following forum/non-published links Redirect topics outside "doc" category to the forum (instead of 404) May 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants