2

I recently had a system crash and had to reinstall WordPress with my backup files.

In the JavaScript log I began throwing errors pertaining to the domain and realized I was still using the remote servers URL. So, I read the Changing the Site URL article in the WP Codex and added the following two lines to my config.php file:

define('WP_SITEURL','http://localhost:3000');

define('WP_HOME','http://localhost:3000');

If I go to localhost:3000 in my browser, it goes instead to localhost and loads the Apache server It works! page. However, I am using PHPs built in server. So please don't drag Apache into this.

I do have the ability to go to localhost:3000/wp-admin and login with admin credentials, however when I try to click any of the admin links, I get a 404 not found:

The requested resource resource name was not found on this server.

Everything was working before the system crash, and I'm fairly confident I started the PHP server in the appropriate directory. Will someone viewing this both tell me how to fix this error, but also more importantly, explain why I can't visit my local version of the site?

Any assistance will be much appreciated. Thanks.

  • Have you tried going to Settings > Permalinks, hitting the Save changes button? – Pmpr Dec 21 '15 at 7:35
  • Thank you for the suggestion, but I am unable to go to settings, it is an admin link. I get a 404 not found. – Keenan Diggs Dec 21 '15 at 8:33
  • Where have u put your wordpress file? please add information to ur question regarding directory structure and show how is ur wordpress root location on ur system – Pmpr Dec 21 '15 at 9:11
  • home/user/work/website is the location of my Wordpress install. It is here that I invoke the PHP server as the WP index.php page is here. – Keenan Diggs Dec 21 '15 at 21:37
1

Instead of renaming, set up your local web server to handle requests to that domain and modify your local hosts file to associate the domain with ip 127.0.0.1.

Especially when debugging hard to find bugs you will want your enviroment to be as similar to the one of the live site.

(I can do it in a not very modern version of WAMP and therefor I assume you can do it with all similar web servers)

0

You can go to your database and check for wp-option table. In that if you will try changing the siteurl and home, I think this will help you out.

  • A fine idea. However, this did not work for me. Besides, I believe my define statments in wp-config.php account for this. – Keenan Diggs Dec 21 '15 at 8:39
0

dump database from remote server open .sql file in a text editor find and replace remote urls to localhost then import the database in localhost

as birgire suggests: this idea is not good for some databases with serialized arrays so i suggest this tool which i have tested and found helpful:

https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

  • 2
    Note that this might not be a good idea for serialized arrays stored in the database – birgire Dec 21 '15 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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