MyBB Community Forums

Full Version: Redirecting old domain to new domain.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have a forum on domain.info, now I want it on domain.net. How do I go about doing this? I need steps from the very beginning. lol I read a bunch of threads on the matter but it doesn't really give me a step by step guide.

Do I need to create a new database for my new domain?
Do I have to get a backup of my forum and upload it to a database for my new domain?
etc. etc.
Same! I'm soon going to change domain, how?
1. Close your forum and backup your database from phpMyAdmin and download all your files
2. Create a new MySQL database from your cPanel, assign a user and a password to it (MySQL cPanel tutorial)
3. Go to phpMyAdmin on your new domain and import your database (that you backed up)
4. In the files that you've downloaded from your old domain, go to [mybb_folder]/inc/, open the file "config.php" with any text editor, find:

Quote:$config['database']['database'] = 'your_old_database';

Replace it with

Quote:$config['database']['database'] = 'your_new_database';

your_new_database is the name of your new database


Find:

Quote:$config['database']['username'] = 'your_old_username';
$config['database']['password'] = 'your_old_password';

Replace with:

Quote:$config['database']['username'] = 'your_new_username';
$config['database']['password'] = 'your_new_password';

your_new_username and your_new_password are respectively the username and password that you've assigned to your database

5. Save, upload these files to your new website, open your forum and you're done
Make an .htaccess on your root and put this one:

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] 

Replace 'newdomain.com' with your forum url.
Another thing:

After re-opening your website, go to Admin CP, Configuration, Setting tab, General Configuration, and change the Board URL to the new url without adding a final slash /

And then on the same page, change the Cookie domain from .domain.info to .domain.net (don't forget the first dot)..
I did all of that but people still get taken to the old domain.

@pdtrx - When I put that code into my new domain no browsers will load the site. When I put it into my old domain it resolves to newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/newdomain.com/thread-123456789.html
Nevermind. I found a solution. Thanks.