Mobile app version of vmapp.org
Login or Join
XinRu657

: Redirect wordpress site to new domain, using wildcard or not both don't work I just moved a wordpress site to a new domain. All of the URLs are the same on the new domain except for of

@XinRu657

Posted in: #Redirects #WebHosting #Wordpress

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: website1.com/2015/05/get-moving-for-mindstrong-lets-stop-the-stigma/ newwebsite.com/2015/05/get-moving-for-mindstrong-lets-stop-the-stigma/
when I go to www.website1.com however it redirects properly to 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

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @XinRu657

1 Comments

Sorted by latest first Latest Oldest Best

 

@Angela700

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 ^(.*)$ www.newwebsite.com/ [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 .

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme