Local wordpress install only shows home page, all other pages Not Found

WordpressLocalhost

Wordpress Problem Overview


I am working on a local install of a live wordpress site, all links from the main page show Not Found errors. all .htaccess files are all present.

The problem is that every page except for the home page is showing a Not Found error, I can't find any problems with permissions or anything else that would cause it to not work.

Is there anything that I can try that I might be overlooking? I apologize for the vauge questions but I am having trouble figuring out where to start.

Wordpress Solutions


Solution 1 - Wordpress

Log in to the admin panel (localhost/sitedirectory/wp-admin) and go to Settings->Permalinks and click Save Changes. Permalinks often need to be rebuilt after mirroring a site and updating the site url. You don't need to change any settings, just hit save and it will rebuild the permalinks with the selected options.

Also make sure the Apache module mod_rewrite is enabled on your local stack. IIRC WAMP (and possible XAMPP) do not enable this by default. Doing so in WAMP is as simple as clicking the WAMP icon in the taskbar, then going to Apache -> Apache Modules -> mod_rewrite (click to toggle) and then restart all services.

Also I am assuming you already updated the site and home urls (either in the wp_options database table or in wp-config.php). For reference there is a Codex page about this: Moving Wordpress

Solution 2 - Wordpress

You can do it in a really simple way. Just go to

Settings >> Permalinks >> and click "save changes" without changing anything.

If it gives you .htaccess file permission issue, you need to set privilege of your ROOT folder (where your wp-content folder lies) to read and write.

And again go to

Settings >> Permalinks >> and click "save changes" without changing anything.

That's all. Hope it resolves the issue.

Solution 3 - Wordpress

Please enable rewrite_module. To enable it on windows wamp follow these click on wamp -> Apache ->Apache Module -> check rewrite_module

Solution 4 - Wordpress

Thought I would just add to this as I was experiencing the same issue but I was unable to access wp-admin to make the update to the permalink.

Be sure to edit your database under wp_options for the siteurl to mirror your localhost. I actually found that even though I did this it didn't solve my issue so I placed the following lines in the wp-config file:

define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');

Once I added these lines I was able to login via wp-admin or wp-login.php and update the permalinks as described in the answer listed.

Solution 5 - Wordpress

Apache -> Apache modules -> rewrite_module and make sure this is ticked. Then save changes to permalinks.

Solution 6 - Wordpress

Another thing is you may have to change your .htaccess. For example, I mirrored my site locally, but in a subfolder, I had to change my .htaccess, but Wordpress gives you the code you need :

Settings -> Permalinks -> See at the bottom of the page.

Anyway, the provided code needs mod_rewrite to work properly, so combine this answer with the previous ;)

Solution 7 - Wordpress

Save permalinks does solve this most of the time, but if you happen to have just moved machines and installed new copy of MAMP theres one other thing to check. In addition to updating hosts and vhosts and all that (for multiple site w/ custom domain setup), don't forget to open MAMP -> preferences -> web server -> apache and make sure you have the document root to where it was on your old machine instead of default /htdocs/! Thats what solved it for me. Props to answer above that mentioned AllowOverride directive, its only when i saw that in http.conf I noticed document root was off. I think you could just edit it http.conf directly but in case MAMP used it for anything else i went ahead and just made the change in MAMP prefs.

Solution 8 - Wordpress

The solution involved a combination of multiple answers from this page:

  1. Change apache's AllowOverride directive to All in your http config.
  2. Restart Apache
  3. Go to Settings->Permalinks and click Save Changes

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionTy UnderwoodView Question on Stackoverflow
Solution 1 - WordpressEnnuiView Answer on Stackoverflow
Solution 2 - WordpressSteele RockyView Answer on Stackoverflow
Solution 3 - WordpressNilesh ModakView Answer on Stackoverflow
Solution 4 - WordpressPedzView Answer on Stackoverflow
Solution 5 - WordpressIsaView Answer on Stackoverflow
Solution 6 - WordpressSebastienView Answer on Stackoverflow
Solution 7 - WordpressDanView Answer on Stackoverflow
Solution 8 - Wordpressow3nView Answer on Stackoverflow