Home > front end >  Wordpress migration to localhost - page not found
Wordpress migration to localhost - page not found

Time:02-01

I migrated a live website to localhost and am having problems with accessing it ("page not found"). I am on windows and am using xampp.

This is what I have done so far:

  1. I migrated a live website to localhost
  2. imported database
  3. changed the siteurl and homeurl in wp_options to localhost/pagename

When I open the page on localhost, the header and footer are displayed, but the content is missing, and I am getting a "Page not found" message instead. All the links in navigation menu (in header) have the correct hyperlinks, but when I click them, I am redirected to http://localhost/dashboard/

I have gone through several guides, including resetting permalinks through wp-cli, but none of them have worked so far. Can you help me?

CodePudding user response:

I am using Windows and Xampp. No other software. I restored my database and made only 2 changes in this file (line 24 and 25).

<?php

define( 'DB_NAME', 'removed' );
define( 'DB_USER', 'removed' );
define( 'DB_PASSWORD', 'removed' );
define( 'DB_HOST', 'localhost' );
define( 'DB_CHARSET', 'utf8' );
define( 'DB_COLLATE', '' );

define('AUTH_KEY', 'removed');
define('SECURE_AUTH_KEY', 'removed');
define('LOGGED_IN_KEY', 'removed');
define('NONCE_KEY', 'removed');
define('AUTH_SALT', 'removed');
define('SECURE_AUTH_SALT', 'removed');
define('LOGGED_IN_SALT', 'removed');
define('NONCE_SALT', 'removed');

$table_prefix = 'wp_';

define( 'WP_DEBUG', false );

// this is done here to prevent database edit (wp-options table)
define('WP_SITEURL', 'localhost/foldername');
define('WP_HOME', 'localhost/foldername');

if ( ! defined( 'ABSPATH' ) ) {
    define( 'ABSPATH', dirname( __FILE__ ) . '/' );
}

require_once( ABSPATH . 'wp-settings.php' );

CodePudding user response:

I don't know well XAMPP but first have you disable WampServer.

In XAMPP Control Panel have you correctly start the Apache and MySQL module (are they green ?).

You can try visiting your site in private mode (with your web browser, or clear your history / cache etc for this site).

  •  Tags:  
  • Related