Hey guys :) I have to following case. I was given a WP site for "fixing". The website is huge in size. It's around 3GB and the DB is around 350MB. Most of the DB size is coming from postmeta table that is around 200MB. So I want to migrate the site on my localhost and try to reduce the DB size and to implement a custom function. Since the size of the site is huge, Duplicator is not working so I had to manually migrate it by downloading the files via FTP and using phpMyAdmin I exported the database. I'm using WAMP on my PC, so I copied the files to my wamp64/www folder, created a new database and imported the copy of the database, I edited the wp_config.php file, I changed the site url from the wp_options table and also using wp_config, I deleted the .htaccess file and after all of this, when I try to load the site using "http://localhost/mySite" or simply "localhost/mySite", the site is not loading and instead I'm prompted to download a file called "download" (no file extension) that contains the same code as the index.php. The /wp-admin directory is also not accessible.. Renamed all plugins and active themes by adding "old" so it will deactivate them, but still no luck.. I'm out of ideas here honestly.. I reached page 7 from the Google results and still no fix of the problem.. :( Any ideas, please? :) Thanks!

Here is the content of the file it downloads:

 * 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 __DIR__ . '/wp-blog-header.php';
  • 1
    I don't know WAMP but it looks like Apache isn't running PHP. Can you check the configuration for that, or maybe restore some of the .htaccess, or try and get a simple PHP example working?
    – Rup
    Commented Aug 3, 2020 at 7:46
  • Hey, thanks for the answer. I created a phpinfo.php file and without the .htaccess file it loads just fine. EDIT: Here is the phpinfo.php file that I load: pastebin.com/MbAaqAcG EDIT 2: Here is the .htaccess file: pastebin.com/uxuMiMBL Commented Aug 3, 2020 at 8:05
  • I would use the default wordpress .htaccess wordpress.org/support/article/htaccess but edit it since you are running inside a folder called 'mySite' replace / with /mySite in both spots Commented Aug 3, 2020 at 9:12
  • Hey, tanks for the answer. Tried replacing the .htaccess with the default one by WP, but still the same problem :( EDIT: Also tried to switch the PHP version to 7.2, because on my WAMP it was 7.3, but still no fix.. It was pretty desperate move, honestly.. :( Commented Aug 3, 2020 at 11:04
  • Could your problem be similar to this: wordpress.stackexchange.com/a/285806/17295 Commented Aug 11, 2020 at 15:56

1 Answer 1


As in this question and answer, and because of your huge .htaccess file it's like you have a .htaccess directive that's causing your apache to not process that file or understand its type.

As mentioned by @Rup, using the default Wordpress .htaccess, and checking other directories for rogue .htaccess files will likely resolve this issue.

If it doesn't, you need to check how apache and this particular vhost are configured as it's likely you've got a rogue .htaccess file or directive causing apache to not be able to process PHP

  • Thank you for that idea, I checked and there were 12 .htaccess files. I deleted them all except the one in the root folder that is the default one for WordPress. Accessing the home page still prompt me to download a file, but I was able to login in the admin panel by adding "/wp-login.php". From there I tried to update the links, but same result with downloading a file when trying to visit the home page. Also from the admin menu there is an option to visit the home page or the shop page. If I click on visit the shop page, the site is loading. Commented Aug 4, 2020 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.