XF 1.2 Fixing internal links after move to subdomain

cmeinck

Well-known member
#1
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!
 

cmeinck

Well-known member
#3
That should work but I would always recommend running it on a test installation first.
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
 

Brogan

XenForo moderator
Staff member
#4
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.
 

cmeinck

Well-known member
#5
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?
 
Top