WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a local server up using EasyPHP. I know its working because I have a default wordpress install running and up on my brower. I have a full site which I also know I have working because when I set up an empty database and then did the wordpress install the theme was working perfectly but without the content. I have a backup of the actual database this site used and when I create a database, and import the data using PHPMyAdmin and connect it in the wp-config.php file I am getting:

Bad Request (Invalid Hostname)

What am I doing wrong?

share|improve this question
Have you updated the database with phpmyadmin to reflect the correct URL? – GhostToast May 31 '13 at 20:16
What home url (and wordpress url) is in the wp_options table? Update: Ah, @GhostToast was faster. :) – Richard B May 31 '13 at 20:17
Do you mean siteurl inside wp_options? I did try to change that and I am still getting the same error. – David Tunnell May 31 '13 at 20:20
I wrote a little function to generate the necessary phpmyadmin SQL script for moving from one domain to another. Put before url in one end, and after url in other. Then select it, copy it, paste it in the SQL box in phpmyadmin and presto-changeo. Backup database first though...can't be held accountable :) tools.morningstarmediagroup.com/find-replace – GhostToast May 31 '13 at 20:23
Go to Settings -> Permalinks. .htaccess needs to be rebuilt (and this will do that for you just by visiting that page) everytime something major like a URL change occurs. – GhostToast May 31 '13 at 21:37
up vote 2 down vote accepted

Be sure you have updated your database to reflect the correct URL. You can do this in phpmyadmin with a bit of SQL. Good article about it here:


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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