Solved

Testing WordPress transfered to new host before nameserver change

Posted on 2011-09-15
7
401 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 

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

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

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

How to install BuddyPress on your self-hosted WordPress site It’s been called everything from “social networking in a box” to “Facebook without the terms of service,” but until Feb. 16, BuddyPress was a relatively unknown outside the WordPress MU…
If you are looking for plug-ins to add functions to your WordPress small business web site, take some time to read though this comprehensive list.  These are all the plugins I use for my customers WordPress web sites, as well as my own.  Be sure to …
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

717 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