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

XF 1.2 Fixing internal links after move to subdomain

Discussion in 'XenForo Questions and Support' started by cmeinck, Mar 6, 2014.

  1. cmeinck

    cmeinck Well-Known Member

    I've migrated from http://www.everythingicafe.com/forum/ to http://forums.everythingicafe.com. My board URL has been updated and the 301 redirect is working well. To continue with the 'clean up' after the move, I thought it would be best if internal links were updated to reflect the new URL structure. So for example, if a user had created a link to: http://www.everythingicafe.com/forum/threads/which-iphone-6-would-you-choose.105238/ , I'd like to use mySQL to update the URLs to http://forums.everythingicafe.com/threads/which-iphone-6-would-you-choose.105238/

    I believe this mySQL query would work and would not adversely affect anything. That being said, I wanted to ask the experts here before running such a big query.

    Code:
    UPDATE xf_post SET message = REPLACE(message, 'www.everythingicafe.com/forum','forums.everythingicafe.com');
    Thanks!
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    That should work but I would always recommend running it on a test installation first.
     
  3. cmeinck

    cmeinck Well-Known Member

    That's a great idea. How's this for a plan:
    1. Turn off forum
    2. Create a duplicate mySQL database
    3. Run query
    4. Change database in /library/config.php to new database
    5. Test
    6. Turn forums back on
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    You wouldn't even need to change config.php - you could just check a few posts directly in the table that you know contain links.
     
  5. cmeinck

    cmeinck Well-Known Member

    The changes appear to be good, but they aren't being reflected in the live forum. If I edit a post, the changes are there. I had a similar issue with BBcode replacement and it was cache that needed to be flushed.

    I rebuilt the search index, but no change. Any suggestions?
     
  6. Mike

    Mike XenForo Developer Staff Member

    That'd be the BB code cache - you can empty the xf_bb_code_parse_cache table.
     

Share This Page