I have a wordpress site set up on a live server, and I have replicated the site locally by following these steps:
- FTPed live files to local
- Set up virtual host (dev.domain.com) to point at local version of site
- Imported the db locally
- changed wp-config.php to the correct local db settings
- changed ‘home’ and siteurl’ in db.wp_options to point to http://dev.domain.com (from http://www.domain.com)
Home page loads fine, /wp-admin all loads fine.
Problem is in links to pages:
Permalinks are set to point to post name: http://dev.example.com/sample-post/, just as on live server. However, locally, all links to posts are broken, and Apache (2.2.17) is responding with the following error: “The requested URL /sample-post/ was not found on this server.”
I’m assuming I’ve missed a configuration step somewhere, though I’ve followed this process umpteen times in the past with no problems. The issue with this particular site is that the theme has been hacked with lots and lots of absolute paths entered, meaning setting up a dev site has required loads of code changes.
I’m not really sure how to further trouble shoot this, not completely understanding how WordPress / Apache handles permalinks
OK – sorted this, it was to do with mod_rewrite on apache.
To fix (this is for my install of Ubuntu 11.04):
first enable mod_rewrite in apache
Then edit the relevant file in /etc/apache2/sites-available (could be ‘default’, or one specific to site):
Change AllowOverride directive for your site document root from None to All:
That seems to have done it.