It appears that this is a common problem, but I have tried every fix I've seen on this forum and still cannot get the local copy of my WP site working. I can view my homepage at localhost/mysite, and I can even view /wp-login.php. However, I cannot view any posts or other non-core pages. I receive 404s on those pages. Additionally, my login information will not log me into the site, even though I have confirmed that all user information survived the database migration.

I am on a local Debian LAMP stack.

Things I have done:

Changed www.mydomain.com to localhost/mysite in the wp_options and wp_posts tables.


define('WP_SITEURL', '/mysite');
define('WP_HOME', '/mysite');

to wp-config.php.

Changed RewriteBase to /mysite/ in .htaccess

Confirmed that rewrite.load is in /etc/apache2/mods-enabled

Changed all cases of AllowOverride None to AllowOverride all in /etc/apache2/sites-available

Restarted Apache

Any idea what I may have missed? Any help would be greatly appreciated.

  • Turn on default permalinks, if that works then your configurations are wrong and this would probably be considered to localized a question. – Wyck Jan 27 '15 at 18:36
  • Thanks, where do I go to turn on default permalinks? Keep in mind I only have access to the filesystem at this point, as I cannot login to the site. – rrr45 Jan 27 '15 at 18:37
  • Reset your login /password in the database and login. – Wyck Jan 27 '15 at 18:59
  • I think I may be on to something. I had stupidly ignored this before, but my browser is actually saying "The requested URL /index.php was not found on this server." As I noted, my local site is at localhost/mysite. Clearly I have a directive wrong somewhere, but I confirmed and my WP_SITEURL and WP_HOME constants are defined as noted above, so they should not be the problem. And the changes to my database are in effect as well. Any ideas? – rrr45 Jan 27 '15 at 19:07

Found the problem. It was with my .htaccess file. While I had changed

RewriteBase /


RewriteBase /mysite

I did not realize I also had to change

RewriteRule . /index.php [L]


RewriteRule . /mysite/index.php [L]

That fixed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.