When I type in https://math.stackexchange.com/questions/47 into safari/chrome, checking its suggestions did not replace the URL, stack exchange goes instead to Can you recommend a decent online or software calculator? and when I type in https://math.stackexchange.com/questions/23, stack exchange goes to Is it true that $0.999999999\ldots=1$?. Somehow, a question with approximately the same ID appears with “/47#47” or “/23#23” concatenated onto the URL’s end. There is no redirecting.

One guess is that questions 23 and 47 do not exist/are deleted and, instead of displaying “error 404”, it goes to a question another question. However, https://math.stackexchange.com/questions/2 is a deleted question and does not do this. Another idea is that it is a bug with math stack exchange.

What is the explanation?

  • $\begingroup$ Also, math.stackexchange.com/questions/4 instead goes to https://math.stackexchange.com/questions/3/list-of-interesting-math-podcasts/4#4 $\endgroup$ Commented Sep 16, 2023 at 13:35
  • $\begingroup$ For the example in the comment, you ended up with the answer which has the URL math.stackexchange.com/a/4. I'd guess it simplifies things if the links math.stackexchange.com/q/4 and math.stackexchange.com/questions/4 go to the same post. $\endgroup$ Commented Sep 17, 2023 at 5:16
  • $\begingroup$ @MartinSleziak You said “if the links $\dots$ go to the same post”. “math.stackexchange.com/q/4” also goes to https://math.stackexchange.com/questions/3/list-of-interesting-math-podcasts/4#4 for you right? $\endgroup$ Commented Sep 17, 2023 at 11:29
  • 1
    $\begingroup$ Yes, all three links mentioned above direct to the same answer. (And have the advantage that the URL is immune to the change of the title, number of pages of answers, etc.) $\endgroup$ Commented Sep 17, 2023 at 13:39

1 Answer 1


A network Meta Stack Exchange site search comes up with the related Logic Behind StackOverflow Question IDs, with Robert Cartaino's answer stating

Stack Overflow uses one table to hold both questions and answers. The ID is the primary key in the table called Posts. The ID is incremented each time a question or answer is posted.

Note this is for Stack Overflow's site, but this site would have a similar table and associated behavior. Also, the question and original answer are from early $2010$ (unfortunately, I've not been able to find anything more recent), but I believe it's likely still accurate. Regardless, since it's from not too long before when your example posts were written, this situation likely specifically applies to them, even if things have been changed later (e.g., more recent question and answer IDs are now in separate tables). It seems the site's software bypasses the "questions" part of the URL and, instead, uses that ID to show the answer with the corresponding ID. Nonetheless, it does this with a special format, e.g., https://math.stackexchange.com/questions/29/can-you-recommend-a-decent-online-or-software-calculator/47#47 for your first example. This is likely to indicate that it's showing something different than what was actually explicitly requested.

Whether or not the site should behave this way, or if it should instead show something like a $404$ error, is debatable. Although I appreciate that the software tries to handle the request in a fairly reasonable fashion, I also would prefer to get an error instead since the displayed result is not what I actually asked for, not to mention that showing an unrelated answer instead is somewhat confusing. Nonetheless, as indicated in Martin Sleziak's comment, it's likely better to maintain backwards compatibility with any existing links using this behavior than changing it now.

  • 1
    $\begingroup$ +1 for finding the related post on Meta Stack Exchange. Considering that the links worked this way since the baginning and the there might be many places relying on the URLs of the form q/{id} or questions/{id} being redirected like this, I don't think that changing this now. (Naturally, if somebody would seriously considering changing how such URLs behave, the right place to suggest that would be Meta Stack Exchange - since this would affect all sites in the network.) $\endgroup$ Commented Sep 17, 2023 at 6:54
  • 1
    $\begingroup$ @MartinSleziak Thanks for your feedback. Although I stated the behavior is not what I would have preferred, I agree with your reasoning that it's likely best to not change it now (I've also updated my answer to indicate this). In addition, as you stated, any such request should be on the network Meta site instead of here, due to the scope affecting the entire network. $\endgroup$ Commented Sep 17, 2023 at 14:14

You must log in to answer this question.

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