Jump to content

Set rules for .htacess 301 when changing domain name


Recommended Posts

Hi

 

Right now I have a site called www.koksredskap.com, we want to change the domain name into www.foodgilla.se but we dont want to loose SEO power and we want to send everyone who search on www.koksredskap.com get sent to the new domain. Also if the customer search for www.koksredskap.com/product1 then they will be sent to www.foodgilla.se/product1 etc,

 

Is there a simple way to do this with .htacess with rules and how do i set it up?

Link to comment
Share on other sites

Hi, I'm not expert but when I moved my shop from eTiendas.co to PrestaHeroes.com and after research I used this

 

Note, my shop is full https, and would not work properly for target shop without or with partial https.

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{HTTP_HOST} ^etiendas\.co$ [OR]
  RewriteCond %{HTTP_HOST} ^www\.etiendas\.co$
  RewriteRule (.*)$ https://www.prestaheroes.com/$1 [R=301,L]
</IfModule>
Link to comment
Share on other sites

So like this?

 

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{HTTP_HOST} ^koksredskap\.co$ [OR]

RewriteCond %{HTTP_HOST} ^www\.koksredskap\.co$

RewriteRule (.*)$ https://www.foodgilla.se/$1 [R=301,L]

</IfModule>

 

Because it doesnt work for me, im suppose to change the htaccess file in the rootmap of the webbshop, correct?

 

This should be only thing in your old domain .htaccess file.  Also change https to http if you are not using ssl.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...