Solved

Testing WordPress transfered to new host before nameserver change

Posted on 2011-09-15
7
388 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
Comment Utility
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
Comment Utility
I'll try it. Thanks.
0
 
LVL 5

Expert Comment

by:zippybungle2003
Comment Utility
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:msnewmark
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks to all!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Wordpress Horizontal Drop-Down Menu In this tutorial I will show you had to add a WordPress horizontal navigation menu to your theme. I have searched and searched for a good tutorial on creating a WordPress nav menu without adding a plug-in or us…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
This video teaches users how to migrate an existing Wordpress website to a new domain.

762 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now