Solved

Testing WordPress transfered to new host before nameserver change

Posted on 2011-09-15
7
395 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:msnewmark
7 Comments
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 36546563
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
 

Author Comment

by:msnewmark
ID: 36547146
I'll try it. Thanks.
0
 
LVL 5

Expert Comment

by:zippybungle2003
ID: 36548022
0
VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

 

Author Comment

by:msnewmark
ID: 36552075
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
 
LVL 3

Accepted Solution

by:
ZenArcher earned 500 total points
ID: 36552305
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
 

Assisted Solution

by:msnewmark
msnewmark earned 0 total points
ID: 36552602
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
 

Author Closing Comment

by:msnewmark
ID: 36572311
Thanks to all!
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question