Testing WordPress transfered to new host before nameserver change

I've transferred a WP blog to a new host and I'd like to test the installation before I change the nameservers from the old host to the new host.
 
Old host: goDaddy.com
 New Host: HostGator.com
 
At both sites the blog is at a domain that is an add-on domain to the main hosting account.
 
I've transferred the DB and the files. When I test with the URL: http://msnewmark.com/DinahSnow.com/ (caps essential) I get the header, but not the content on the main page.
 
What I would like to see is at: http://dinahsnow.com.
 
My question is, will this anomoly fix itself once I change the nameservers?
 
Thanks,
 Martin
msnewmarkAsked:
Who is Participating?
 
ZenArcherConnect With a Mentor Commented:
Martin,

Your problem arises because the WordPress database is looking for a permalink that is defined on the other server. The header you see is actually coming from the GoDaddy site.

The best way to set up a new server and test it fully is to hardcode the IP address in the site home and site URL variables. This will override the domain naming issue. Hostgator cPanel shows this IP info in the sidebar.

Simple edit the config.php file with your FTP program and the hardcoded values will override the database values.

Edit wp-config.php
It is possible to set the site URL manually in the wp-config.php file.

Add these two lines to your wp-config.php, replacing "example.com"  with the IP address of your site.

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Open in new window


I believe, in your case it would be: 216.172.180.209.
NOTE:
But because it is an add-on domain, you will need to add your username or something "/msnewmark/" to the URL string. Check with Hostgator for a temporary url suggestion.

NOTE: this is 99% of your solution.
define('WP_HOME','http://216.172.180.209');
define('WP_SITEURL','http://216.172.180.209');

Open in new window


SEE http://support.hostgator.com/articles/temporary-url for your precise URL.


Temporary URL
The temporary URL is used when your domain name is not working. Here is an example of the format, your actual URL can be found in your New Account Info email.

Hosting with cPanel:
http://serverIP/~cpanelusername/
(Be sure to replace "serverIP" and "cpanelusername" with the actual values.)

Hosting with Plesk 10:
https://serverIP:8443/sitepreview/http/mydomain.com/
(Be sure to replace "serverIP" and "mydomain.com" with the actual values.)

Hosting with Plesk 8 and 9:
http://serverIP/$sitepreview/mydomain.com/
(Be sure to replace "serverIP" and "mydomain.com" with the actual values.)

Note: If you forget the trailing forward slash (at the end) the you may be redirected to a different URL.

You can actually use any domain or server name followed by /~cpanelusername/ to see that user's site. This will cause any domain on the server to show the site for the username. That's how cPanel setup works so we can't prevent this method from showing someone else's site on your domain.

Here is the format for addon and subdomains.

Hosting with cPanel:
http://serverIP/~cpanelusername/path_aka_document_root/
(Be sure to replace "serverIP", "cpanelusername", and "path_aka_document_root" with the actual values.)

Hosting with Plesk 10:
https://serverIP:8443/sitepreview/http/otherdomain.com/
(Be sure to replace "serverIP" and "otherdomain.com" with the actual values.)

Hosting with Plesk 8 and 9:
http://serverIP/$sitepreview/otherdomain.com/
(Be sure to replace "serverIP" and "otherdomain.com" with the actual values.)


Best,
Tony
0
 
Jason C. LevineNo oneCommented:
You might need to mess with the settings for the front page on the testing server to get the page to show up.  Sometimes moving environments confuses WordPress.

Try setting the front page to something different (like About), save it, test, then put your preferred front page content back.
0
 
msnewmarkAuthor Commented:
I'll try it. Thanks.
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

 
zippybungle2003Commented:
0
 
msnewmarkAuthor Commented:
I have read that, but it didn't address my particular question. The process they mention for keeping the old site running may work in this case. Thanks.
0
 
msnewmarkConnect With a Mentor Author Commented:
Tony,

You rock! Your solution took me most of the way there. I knew it was a problem like this, but I had no idea about setting those variables in the config file.

The one thing that was missing is a change to the .htaccess file to get the permalinks to work. If you use the info at the wordpress site that zippybungle2003 mentioned you get the total solution. When you change the WP_HOME and WP_SITEURL using the WP control panel it changes the .htaccess file to look like:  
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~newmark/DinahSnow.com/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~newmark/DinahSnow.com/index.php [L]
</IfModule>

# END WordPres

Open in new window


The two lines that refer to DinahSnow.com are changed and make permalinks work. With out that change only the homepage works.

Thanks to everyone for your help!

-Martin
0
 
msnewmarkAuthor Commented:
Thanks to all!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.