Chris

Lee

Content

Copywriting

Design

Only the homepage works on local WordPress site: a fix


June 3, 2018

This won’t be relevant for many people reading this blog, but I’m posting on the off chance that it’s useful to someone frantically Googling “how to set up a local version of a WordPress site“, and not finding anything that worked completely.

(Much like I was for the past two hours).

There are multiple useful resources. This one for an outline of the duplication process, as is this one.

The problem is that both didn’t quite work, and I could find a resource that successfully answered the question “why do I only have a functional WordPress backend and access to my homepage, but every other page gives an error message?

So if you’re seeing something like the image below, and only your homepage works after a WordPress migration, try these things.
localhost error message

How to get your localhost WordPress site working properly


Try this list of things first, which I collated from various guides and StackOverflow questions (for all of them replace the URL with your relevant localhost URL):

  • Change value in siteurl field in wp_options in table phpMyAdmin to http://localhost/mysite
  • Change value in home field in wp_options table in phpMyAdmin http://localhost/mysite
  • Update wp-config in your local site files to have the correct database login credentials
  • Ensure URLs in Settings – Permalinks in WordPress begin with http://localhost/mysite
  • Clicke ‘Save Changes’ in Settings – Permalinks from the WordPress backend
  • Test
  • Toggle RewriteModule on in Apache Services in WAMP
  • Restart all services on WAMP
  • Test
  • Change all instances of AllowOverride none to AllowOverride all in httpd.conf in WAMP
  • Restart all services on WAMP again
  • Test
  • Click ‘Save Changes’ in Settings – Permalinks from the WordPress backend again
  • Test

Most people seemed to achieve success somewhere in that list, but I needed two more steps:

  • Delete the htaccess file
  • Click ‘Save Changes’ in Settings –  Permalinks from the WordPress backend again

Now I have a functional local version of my WordPress site so I can tinker and break things without fear of public embarrassment ????