• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.5 Change from #post-id to #postid

#1
Hello,
I am migrating from an old vBulletin to Xenforo.
In my old vbulletin the url of a single post in a thread is like
...threadname/#postpostid
Example /hello/post4

In Xenforo instead, the url is
/hello/post-4.

Well, I need to modify Xenforo in order to have
/hello/post4 also in Xenforo.
I need to eliminate that - between post and postid.

Thanks
 
#3
If I press #2, your post, this is the permalink that I find:
https://xenforo.com/community/threads/change-from-post-id-to-postid.113963/#post-1050052

Many people, in their blog or in their forum, often link individual posts of my vbulletin based forum.
I need not loose all this traffic, so I am writing the redirection rules for my server, and I have now the problem that on my vbulletin I have the permalink
#post1050052 (without the - )
while on Xenforo the permalink is #post-1050052

I need to change the url of the post in Xenforo from #post-1050052 to #post1050052

I know that I cannot write redirection rules for what follows #, I m writing the rules for the first part of the permalink, but if what follows # should be the same, modern browsers should do the rest of the job.

To be more clear.
My old vbulletin Url .../threadname-threadid/ will be 301 redirectet to /threadname.threadid/
but a user that will click on a referral link like /threadname-threadis/#postpostid will arrive to the correct post, if he has a modern browser, only if the Xenforo permalink should be /threadname.threadid/#postpostid .. and not /threadname.threadid/#post-postid

i need to eliminate the - after #post ... that's all.
 
Last edited:

island

Active member
#4
Did you solve this?

{$messageId} in the message template returns post-1234 with the post- already appended.

I have my vbulletin urls redirecting correctly to multipage threads, except that my links have #post1234 and xenforo has #post-1234 so redirected links don't scroll to the correct post now, but do get the correct page.

Is there a way to get just the 1234 part of the message ID in the message template so I can create an additional anchor post1234 (with no -) to preserve all existing links from previous software?
 

island

Active member
#5
Found this message while searching
https://xenforo.com/community/threads/get-current-post-id.118222/

And adding
<a name="post{$post.post_id}"></a>

in the message template seems to work for the vbulletin # redirection.

(I tried dumping the variables in the message template with
{xen:helper dump, $message} and {xen:helper dump, $post}
before posting to see what was available, but didn't get anything returned trying message or post in the message template, only {xen:helper dump, $thread} which returned a number of variables but nothing for the post/message in question such as its ID... but the above seems to work for me.)