Issues with local WordPress setup showing 404 for pages apart from the homepage

I’m facing an issue with my local WordPress installation. I’ve transferred a live WordPress site to my local environment for testing, but I’m encountering a frustrating problem.

The main issue: Only the homepage loads as expected. Whenever I attempt to access any other links, it results in 404 Not Found errors.

What I’ve confirmed so far:

  • All .htaccess files are present and appear to be correct
  • Permissions seem fine
  • The site operates without any issues on the live server

Details about my setup:

  • WordPress running locally
  • Site copied from a fully functional production version
  • Database import succeeded without errors

I’m really unsure of what to do next. Has anyone else had similar problems with local WordPress setups? I would appreciate any troubleshooting tips or solutions you might suggest.

This is a permalink structure issue that happens all the time when moving WordPress sites locally. Homepage works but everything else throws 404s? Classic sign that Apache mod_rewrite isn’t enabled on your local server. I’ve hit this exact problem when I started doing local dev work. Your .htaccess might look fine, but most local Apache setups don’t have mod_rewrite enabled by default. Check your Apache config and turn on the rewrite module. Using XAMPP or WAMP? There’s usually a control panel option for it. Once you’ve enabled mod_rewrite, restart Apache and head to your WordPress admin. Go to Settings > Permalinks and just hit ‘Save Changes’ - don’t change anything. This makes WordPress regenerate the rewrite rules. Fixed it for me every time I set up a new local environment.

check your virtual host config too - hit this exact issue last month. even with mod_rewrite on and urls fixed, apache might be blocking .htaccess overrides for your directory. find the AllowOverride directive in httpd.conf and make sure it’s set to All, not None. wordpress rewrites won’t work otherwise.

Had the exact same headache migrating sites locally. Oscar64 nailed the mod_rewrite issue, but there’s another culprit that gets missed all the time - WordPress URL settings in your database. When you imported the database, wp_options still has your live site URLs. Even if you set WP_HOME and WP_SITEURL in wp-config.php, WordPress sometimes gets confused about routing. Check wp_options for ‘siteurl’ and ‘home’ entries - they’re probably still pointing to your live domain. Update them to http://localhost/yoursite or whatever your local setup is. I’ve seen this exact thing where homepage works fine but internal links break because WordPress generates URLs using the old domain. Update those database values, clear cache, and test again.

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.