Jump to content

Forum Post Minimal URLs


Recommended Posts

I was dusting off my Awesome ProcessWire repo and updating it with more relevant information.  One thing that bothered me is that the various links I have in there to forum posts may have changed, but this forum software correctly forwards it to whatever the latest URL is.

While the forum doesn't expose an actual canonical URL for a post, I found this little hack to make it as minimal as possible.  Let's say you have this URL:

https://processwire.com/talk/topic/29951-weekly-update-%E2%80%93-26-april-2024-%E2%80%93-profields-table-v29/

That bothers my "OCD" and if the post title were to be changed, the URL would change accordingly, but I figured out you can chop off everything after the post ID and following dash and add an extra dash if you want a canonical-like, minimalized URL.  It would look like this:

https://processwire.com/talk/topic/29951-- (two dashes required)
  • Like 7
  • Thanks 2
Link to comment
Share on other sites

That was likely a conscious decision with their htaccess rules to prevent numerically traversing an entire forum (and instead requires parsing HTML to identify internal hyperlinks, so more processing power on the part of bad bots). Good find though! I much prefer shorter links. ?

  • Like 1
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...