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

Update old forum URLs within message after re-direct

Discussion in 'General PHP and MySQL Discussions' started by nrep, Mar 15, 2015.

  1. nrep

    nrep Well-Known Member

    I've merged 2 forums together, however there are a significant number of links within forum messages that link to one of the old forums where the threadids no longer match.

    For example, I have links in (xf_post > message) to www.oldsite.com/showthread.php?t=123 and I have the import log (import_log_vb) which tells me that "old_id" of 123 matches "new_id" of 5000.

    I know how to find and replace to change the URLs, but I can't see how I can also do a sub-query to switch over the old thread id to the new one. If that was possible, I could then batch fix all the URLs to www.newsite.com/threads/5000/ etc...

    Is there a MySQL function that can do this?
  2. nrep

    nrep Well-Known Member

    I couldn't figure this one out, so I've just re-directed the pages via an intermediary PHP page which seems to do the trick :).

Share This Page