Ty Underwood
Ty Underwood

Reputation: 897

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

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.

Upvotes: 74

Views: 70501

Answers (8)

ow3n
ow3n

Reputation: 6597

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

Upvotes: 0

Dan
Dan

Reputation: 194

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.

Upvotes: 0

Pedz
Pedz

Reputation: 478

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.

Upvotes: 4

Steele Rocky
Steele Rocky

Reputation: 641

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.

Upvotes: 32

Nilesh Modak
Nilesh Modak

Reputation: 361

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

Upvotes: 9

Sebastien
Sebastien

Reputation: 1102

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 ;)

Upvotes: 2

Isa
Isa

Reputation: 31

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

Upvotes: 3

Ennui
Ennui

Reputation: 10190

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

Upvotes: 131

Related Questions