MyBB Community Forums

Full Version: Change all links to new domain
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
May peace be upon everyone,

I recently got nayarweb.com and i shifted by board successfully to it. My 301 redirect for the ex-domain is working perfectly.

I got lots of internal links on that site. How can i make an SQL query or another, to alter all links in my database automatically
from
nayarweb.co.cc/forum/
to
nayarweb.com/forums/

I am a total n00b Blush
Best Regards
UPDATE `mybb_posts` SET `message` = REPLACE(message, 'nayarweb.co.cc/forum', 'nayarweb.com/forums') WHERE `message` LIKE '%nayarweb.co.cc/forum%';

Make sure you've backed up your posts table before trying this.
Thanks a lot Matt

It worked like a charm Smile
Wow that's pretty cool. Bookmarked.
:O That's awesome.
i made a beta guide on how to change your forum domain Big Grin

you can omit the WHERE message LIKE part, since the REPLACE already does the same check by itself
Ah OK, I thought that might make it a bit quicker.