12

I have found mentions of various Stack Exchange engine URLs (/question/NNNN, /question/NNNN/question-title-spelled-out, /answer/NNNN, /user/NNNN, /q/NNNN, /a/NNNN, /u/NNNN, etc.) scattered around in different places, including sometimes just-in-passing mentions that a link can also including a user id, /a/NNNN/UUUU or can have suffixes such as ?lastactivity or ?rq=.

Is there some unified location where all these sorts of URLs are documented?

(I did find https://api.stackexchange.com/docs which documents the somewhat-similar-looking API calls, but am trying to find documentation for the regular Stack Exchange engine website URLs instead.)

  • Nice question, I've been thinking for a while about asking something like "how many specifically coded URLS should link to a certain question/answer?" – Stormblessed Aug 15 at 0:34
  • I've added a rather long list for the 'core' Q&A functionality and user pages, since they are used most often. I realize I've skipped e.g. the Help Center, review pages, elections, and probably a dozen other topics. I'm not sure if those are really interesting and worth documenting, since they do not involve so many redirects/hidden parameters. – Glorfindel Aug 15 at 8:12
  • @Glorfindel, yes I was particularly interested in the "shortcut" URLs which redirect within the Q&A system, e.g. URLs that might be suitable for linking to a specific topic and/or answer on some external Wiki page. – Nathan Aug 16 at 18:52
8

There is a List of unlinked pages on Stack Exchange sites but it only covers URLs you normally wouldn't find. I don't think there's a unified location document for 'public' URLs, so here's an attempt:

Questions

  • Canonical form: /questions/[question ID]/[question title]
    • Most links generated by the site itself have this form (e.g. question lists, sidebar widgets)
    • [question title] is not the full title if it's longer than 80 characters
    • What you type as [question title] doesn't matter; if you type something else, it'll still redirect to the canonical form (which exists for SEO purposes)
    • If you use an answer ID instead of a question ID, it'll still work and redirect to the canonical form (of the answer)
    • Parameters (here is an extended list, not sure if it's up to date):
      • lq=1: visited from the Linked Questions sidebar widget
      • rq=1: visited from the Related Questions sidebar widget
      • noredirect=1: prevents redirection to original question (only active for anonymous users)
      • lastactivity: links to the last activity (edited post, new answer) on the page
      • cb=1: visited from the Community Bulletin (sidebar widget with Meta posts and blog links)
      • r=SearchResults: visited from a search results page
  • Short form: /q/[question ID] or /q/[question ID]/[user ID]
    • This is the link you get by clicking the share link underneath a question; the user ID is the one currently logged in, not the author. It makes sure the link counts for the Announcer badge and its kin.
    • If you use an answer ID instead of a question ID, it'll still work and redirect to the canonical form (of the answer)
  • An obscure form, used in the newsletter: /landing/r/newsletter?cta=question&id=[question ID]

Answers

  • Canonical form: /questions/[question ID]/[question title]/[answer ID]#[answer ID]
    • This is basically an extended version of the canonical question URL; again, only the question ID and the last answer ID matter (the latter because it scrolls the page to the right position).
    • The first answer ID matters if there are too many answers to fit on a single page; it makes sure the correct page is displayed.
  • Short form: /a/[answer ID] or /a/[answer ID]/[user ID]
    • If you use a question ID instead of an answer ID, it'll still work and redirect to the canonical form (of the question)
    • The global inbox uses this format (with noredirect=1) when somebody posts an answer to one of your questions.

Posts / revisions

  • Edit post: /posts/[post ID]/edit
  • Revision history: /posts/[post ID]/revisions
    • Can be visited via the 'edited x hours ago' link underneath a post, but works when there is only a single revision too.
    • The global inbox uses this format for notifications that one of your posts has been edited.
  • Single revision (rendered): /revisions/[post ID]/[revision number]
  • Edit post, starting from a particular revision: /posts/[post ID]/edit/[revision GUID]
  • Single revision (markdown): /revisions/[revision GUID]/view-source

Comments

  • Canonical forms:
    • /questions/[question ID]/[question title]#comment[comment ID]_[question ID]
    • /questions/[question ID]/[question title]/[answer ID]#comment[comment ID]_[answer ID]
    • Most of the remarks about questions and answers applies here, too
  • Short form: /posts/comments/[comment ID]
    • This format (with a noredirect=1 parameter) is used in the global inbox.

Users

  • Most URLs support current instead of a user ID. This will automatically be populated with the user who is currently logged in, so e.g. /users/current will redirect to your own user page.
  • Canonical form: /users/[user ID]/[display name]
    • What you type as [display name] doesn't matter; if you type something else, it'll still redirect to the canonical form (which exists for SEO purposes)
    • For your own user (for ♦ moderators, all users), this shows the Activity page; for other users, the Profile page
    • Navigation is possible with
      • the tab parameter (for the top tab: Profile / Activity and the second Activity tab (Summary / Answers / Questions etc.)
      • the sort parameter (for subtabs; sometimes it does affect the sorting, e.g. answers by votes or by creation date; sometimes it's just an additional filter, e.g. with votes)
      • the page parameter
  • Short form: /u/[user ID]
  • Flag summary: /users/flag-summary/[user ID]
    • Normally only works on your own user ID; ♦ moderators can view other users' flag summaries as well.
  • Edit profile page: /users/edit/[user ID]
    • Normally only works on your own user ID; ♦ moderators can edit other users' profiles and some of the subpages as well.
    • Edit subpages have their own URL structure, e.g. /users/email/settings/[user ID] for the email settings and /users/delete/[user ID] for the 'Delete account' page.
  • Great, thanks, very helpful. Just curious how you came to know about all of these? Was it just making a mental note of URLs you noticed as you used the system over a period of time, or was there some more direct route to compiling this information? – Nathan Aug 16 at 18:48
  • 2
    ... let's just say I spend too much time here ... – Glorfindel Aug 16 at 18:52
  • As an example, while researching for this answer I stumbled upon the /posts/comments/ short form. I never knew it existed, until I checked a few obvious places to look for system generated URLs. – Glorfindel Aug 16 at 19:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .