Welcome to WebmasterWorld Guest from

Forum Moderators: phranque

Message Too Old, No Replies

Wordpress theme under wrong URL after primary domain change

Oh! What a tangled web we weave...

1:57 pm on Apr 23, 2012 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 24, 2005
posts: 178
votes: 0

Oh! what a tangled web we weave, when under the wrong URL a Wordpress theme we leave.

A month ago I installed a Wordpress shopping cart theme in a Godaddy web hosting account under the domain example.us. The WP theme IS the website. Everything went well.

I configured the theme, added some product with the images. 12 hours of work.

Then a couple of days ago the client bought the lost .com version of his domain back from a squatter and wanted me to move the site to example.com. My problem is that I wasn't smarte enough and listened to a Godaddy tech guy who gave me advice on how to simplify things-- and that has caused huge problems. I 301 redirected example.us to example.com, but the WP theme hosted at Godaddy is still running under the URL example.us. Obviously, I can't let this continue, but I don't know how to get out of the mess.

The example.com registrar is not Godaddy. Its nameservers are set to Godaddy's, where the site is hosted under example.com.

The Godaddy web hosting account for example.us now only serves to execute the 301 redirect. But in the web hosting account for example.com the WP theme still has the URL example.us.

The redirect works and the site itself works properly at this time.

What is the best way to get the WP theme into the example.com web hosting account at Godaddy? I hope I'm not facing a complete re-install and re-doing the whole enchilada over again.
5:26 pm on Apr 23, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Nov 28, 2004
votes: 0

Well the first thing to ask is did you change the site URL in the wordpress admin? That may be all you need.

Otherwise the solution is easy, done it many times, and reverted in and out when things when south.

First do a global search in your theme for any hard coded references to .us. Swap them all out. A strong text editor that can search for strings without opening the files is extremely helpful (Homesite here!) Have them ready.

Go into PHPmyAdmin, select export, do a database dump. In this dump, make sure to select the box that says "add /drop table syntax". When you re-import, this is what you want, otherwise it will halt with "table already exists." Also make sure it's set for download (file.)

Download and open this .sql file in a strong text editor that has robust search and replace capabilities (it will be very large and choke many editors.) **Immediately** re-save it as "example-mod.sql" or something.

Do a search and replace for example.us and replace it with example.com. Save the dump.

Now back to phpMyAdmin and select import, import this file . . . done. Upload the revised theme files if anything changed in them.

The only thing I've seen go sideways is some plugins somehow lose settings, and you might have to disable and re-enable them. But if it does . . .just re-import your original unmodified database file (You got the part about save as, right? This is pretty important.) All this takes about 3 minutes.

Once it's working at .com, go back to .us and revise the 301's.
5:51 pm on Apr 23, 2012 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 24, 2005
posts: 178
votes: 0

Thanks for the help rocknbil. And yes, I had already changed the URLs in WP Settings.
8:35 pm on Apr 23, 2012 (gmt 0)

New User

5+ Year Member

joined:Apr 23, 2012
votes: 0

Great advice rocknbil :)

jastra, The advice rocknbil gave you should work. Please make sure to also attach your new domain to the hosting account. To do so, you can change the domain name from the hosting control center under settings > domain management, or you can alias the domain name and point it to the root from the same page.

Before making any changes to the DB, make sure to back it up either via phpMyAdmin, or through the hosting control center under the Database > MYSQL section.

To Back up a MySQL or MSSQL Database

1.Log in to your Account Manager.
2.Click Web Hosting.
3.Next to the hosting account you want to use, click Launch.
4.In the Databases section of the Hosting Control Center, click the icon for the type of database you want to backup.
5.Click the edit (pencil) icon next to the database you would like to back up to open its edit features.
6.Click the Backup icon in the menu bar.
7.Click OK to backup your database.

If you run into issues, you can send me a Sticky Mail on here.
8:52 pm on Apr 23, 2012 (gmt 0)

Junior Member

10+ Year Member

joined:Nov 24, 2005
posts: 178
votes: 0

Thanks Gabe GoDaddy-- I appreciate that you've got my back.

Yep, I made the .com the primary domain for the hosting account, but the WP blog stayed under the .us domain. Everything is working OK on the Web, but nothing's under the .com TLD-- it's still under .us in the GoDaddy "My Applications" page.

8:03 am on Apr 27, 2012 (gmt 0)

Full Member from IN 

5+ Year Member

joined:Sept 9, 2010
posts: 235
votes: 0

Better if you use the same database, you can connect both.