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 exported and imported my wordpress project into live server. Now the problem is I have permalink structures as "localhost" format. When I click on any links in my website it redirects me to localhost. How can I change that? my .htaccess file is given below

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /myproject/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /myproject/index.php [L]
share|improve this question
just a side note. Always use Duplicator WordPress plugin for moving WordPress websites. It is quite a peace of mind. wordpress.org/plugins/duplicator – Omar Tariq Jan 5 '14 at 16:20
up vote 0 down vote accepted

It sounds like you have not properly updated the "WordPress Address" and "Site Address" at wp-admin -> Settings -> General, or you have defined WP_SITEURL and WP_HOME in wp-config.php and did not adjust the value when the site was moved.

I can't comment on whether the .htaccess file is correct, though I can say that it would be correct for certain sub-directory installs.

share|improve this answer
if my local is localhost and live sever is mysite.com/myproject, what shoul be the wp_siteurl and wp_home ? – Spam Box Jan 5 '14 at 16:52
They most likely should both be http://mysite.com/myproject on the live server. – s_ha_dum Jan 5 '14 at 17:06

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.