Hi Jake, thanks! I have imported from vb and the redirection script works for threads alone. But once I have a redirection to a special post within a thread, the redirection script
- does not direct me to the right page
- and therefore does not direct me to the right post.
This is a sample URL:
showthread.php?t=123&page=3#post546878
-> anchor redirection is possible with jquery for the anchor
Sometimes vb4 writes the same topic like this:
showthread.php?t=123&page=3&postid=546878#post546878
-> anchor redirection is possible with jquery for the anchor
-> anchor redirection is also possible also with &postid
It doesn't try to keep the specific page as it stands. And I don't think "postid" is normally in URLs like that - is that a vB4 thing? (We have redirects for "p".)
So onces I migrate to xenforo from vb all my thread page urls are not taken care of?
And the post-anchors are also not taken care of, right?
My users very often link within threads to other posts within the same thread, this information would all be lost?
This is not only huge for my members but also for SEO as my site structure is also built on the various inline-linking which all now would permanently redirect to a different content.
"postid" was a vB2 thing. vB3 and vB4 use "p" by default but they also recognize "postid" (probably to maintain compatibility with old links). It's the same for "threadid" and "t".
As I said, the server can't manipulate anchors. The server can't see the anchor because it is not sent as part of the request. Here is a demonstration of this that I found a while ago:
I don't understand why not even the right page is served when the page is given in the url, or when xf looks up a post and delivers a thread, then the thread should be served with the right page. Is there even a old_id | post table stored after the import? If yes, you could use this. The current implementation of the 301 redirector is rather basic. It should not be hard for any xf addon dev to fetch the anchor with jquery and then redirect to the right page.
The page numbers don't necessarily match up. The number of posts per page might be different. So if the URL provides a threadid and page number then XenForo can only redirect to the threadid. I just tested and confirmed this:
I suppose the redirect script could check the number of posts per page and then specify the page only if that number is the same. That would require the importer to record the number of posts per page in the import log.
As for the postids... if a postid is given in the URL then it is redirected to the correct page with an anchor. I just tested this myself. For example:
When the URL contains a postid you can make a correct redirect like this. But the postid must be part of the query string. If the postid is only specified as an anchor then the server won't see it. As Mike suggested, this may be possible with javascript.
Thanks very much for your very helpful post. I have the same posts/page setup in both my forums, how else would the pages match I have missed the outstanding ?p redirection, this is excellent integration from xenforo!
Once there is an integration for pages, too I am migrating to xf. But without that, I'd very much have my IDs stay the same after the migration so that none of these anchor issues are even there.
Maybe. Updating forum links after an import requires mapping the old ids to the new ones, and that find / replace tool doesn't do that. It is useful for updating BB codes and updating links to point to a different directory if you move your forum, but it doesn't do any id mapping like the redirect scripts do.
Here are some specific examples of how that addon can be used:
From a short view over Kiers script, in PostReplace.php you can easy configure public function actionReplace() to query through each found old_id and replace it with the current new_id. Pretty easy but powerful stuff.