I just moved a wordpress site to a new domain.

All of the URLs are the same on the new domain except for of course the root url. the domain is on godaddy, and I can forward it but that won't keep the Urls.

the new domain was setup as a brand new wordpress site. It was a redesign so new theme/options/plugins.

After the theme was all setup I ran the wordpress import/export for the old posts.

the Urls are identical:

example: http://website1.com/2015/05/get-moving-for-mindstrong-lets-stop-the-stigma/


when I go to http://www.website1.com however it redirects properly to http://newwebsite.com

it is only when i go to the old url post link, that it continues to load the old url, without css.

The domain is on godaddy, and hosted on a smaller hosting company.

The redirect was done through the hosting companies cpanel. I just "wildcard" to forward with and without www.

  • We can't help you because we don;t know how you did your redirects. Post that here so this question can be re-opened.
    – John Conde
    Commented May 22, 2015 at 22:04
  • updated a little bit to hopefully make it a little clearer
    – Sackling
    Commented May 22, 2015 at 22:13
  • 1
    When you use cPanel to setup a redirect, all it does is edit your .htaccess file and add a directive or two - you need to paste the code that cPanel has added, to your question.
    – MrWhite
    Commented May 22, 2015 at 22:49
  • Have you changed the URL in the dashboard under settings > general?
    – Steve
    Commented May 23, 2015 at 2:09
  • 1
    w3d is correct. I reopened this, however we'll need to see your .htaccess code in order to answer this specifically. That should be located in the root directory of your site and accessible via the File Manager. Please edit your answer to include that. Thanks.
    – dan
    Commented May 23, 2015 at 3:25

1 Answer 1


This code is what you need in the first lines of an .htaccess file in the old website document root folder (provided the old server runs apache with mod_rewrite module installed):

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.website1\.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^website1\.com$ [NC]
RewriteRule ^(.*)$ http://www.newwebsite.com/$1 [R=301,L]

That way, when someone accesses the old domain with or without the www, they will be redirected to the new URL with the rest of the friendly URL added.

If that doesn't work out for you, then you may need to ask the old hosting provider to put the above lines directly in the core apache configuration file (httpd.conf) at the top and restart apache. The dots in the RewriteCond are escaped so that they are taken literally as dots instead of a matching instruction. If you need to add dots in the RewriteCond lines, then use \. instead of .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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