Reputation: 11
I have a thousand URL in my old domain. I want to make a new domain and redirect all url from old domain to new domain.
For example my old domain is http://www.domain1.web.id/
my new domain is http://www.domain2.com/
.
And for example url a content from my old domain is http://www.domain1.web.id/itazurana-kiss-the-movie-propose/
and I want to redirect that content url to my new domain.
so, url will be like this in my new domain http://www.domain2.com/itazurana-kiss-the-movie-propose/
.
by the way I am using Wordpress.
what I have to do to redirect all my old url to a new url.
Upvotes: 0
Views: 54
Reputation: 1662
You can achieve this by adding rewrite rule in your .htaccess file. Open your .htaccess file and paste the following code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^domain1.web.id$ [OR]
RewriteCond %{HTTP_HOST} ^www.domain1.web.id$
RewriteRule (.*)$ http://www.domain2.com/$1 [R=301,L]
</IfModule>
Upvotes: 1