Moved WordPress to New Server, Now Tries to Download a File

Let me start by saying that I have moved dozens of websites from one server to another, without issue.

I recently moved a website and when the URL is visited, a file named “download” with no extension and only a 1KB file size downloads automatically. I backed up all files and downloaded the databases using four different methods, just to make sure: BackWPup, BackUpWordPress and manually by zipping the files & downloading the files via FTP.

The original website works perfectly on the original server.

I used the method I’ve always used when moving to a new server.

On the new server:

  1. Create new DB, user and import database
  2. Upload files and unzip
  3. Edit wp-config.php with new DB name, user, password
  4. Change the website URL using the functions.php method in the WordPress Codex, here – http://codex.wordpress.org/Changing_The_Site_URL

I should also mention that I uploaded the site to three different servers (including a sub-domain on the original server), all with the same result.

In addition to the methods mentioned above, I tried the following things to try to troubleshoot:

  1. Changed the “plugins” folder name to see if a plugin was causing
    the error
  2. Changed the active theme folder name to see if the theme was causing the error
  3. Changed WP_DEBUG to “true” in wp-conig.php – But the site never loads, so no errors are displayed.

Currently, the erroneous website is located at – http://cgdev.webworksplayground.com/

Thanks for the help.

4

I guess you haven’t taken a look at the file that is served for downloading, if so you would have seen this:

<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */

/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define('WP_USE_THEMES', true);

/** Loads the WordPress Environment and Template */
require( dirname( __FILE__ ) . '/wp-blog-header.php' );

Which could have been easily identified as the content of the index.php file inside the root of your WordPress installation.

Regarding the cause(s) for this behavior, check if you are having the correct file permissions, make sure your htaccess file is correct. Besides that some other hosting related settings could be incorrect, see Codex: Hosting WordPress (not very informative though) or on here What are best practices for configuring a server for WordPress sites?.

The above should get you started. I actually pretty much did have to make a – somewhat educated – guess about the reason(s), so inspect that deeper yourself, but I’m fairly certain the origins are in the general area that I addressed.

Leave a Comment