Jump to content

Creating a link to a comment from a post ID


eGullet
 Share

Go to solution Solved by bfarber,

Recommended Posts

Over the years there have been many (many, many!) different ways of linking to specific comments. One way that used to work takes the form:

{Base URL}/index.php?do=findComment&comment={comment ID}

It is a tough one to map directly to a modern link because it doesn't have the Topic ID in it. I typically try to keep these old links alive by adding ModRewrite rules in .htaccess, and that particular older form was my go-to when the URL didn't contain the TID. So... fast forward to 2020, and v4.5, which no longer supports that style of link. Is there an equivalent? That is, I need a link to a post that doesn't require the topic ID (I'm trying to avoid fixing this with a custom plugin that looks up the TID, I'm hoping there is just some sort of link that I can plug straight into .htaccess).

Link to comment
Share on other sites

  • Solution

I'm drawing a blank trying to think of a "normal" way to do this, but one option is to just fudge the topic URL. Pick a real topic id (any one, doesn't matter) and then do this:

https://invisioncommunity.com/forums/topic/458741-a/?p=2832063

or to match your example

{base url}/topic/458741-a/?p={comment id}

The forum application will see the "p" parameter, look up the URL to that specific post and send you to the real URL.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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