spartans
spartans

Reputation: 33

How to redirect urls old to new for e-commerce products urls?

We have migrated one e commerce site to another e-commerce..

In that we have migrated entire products from old site to new site.. my products urls looks likes in old sites below..

For that i want to write some condition.. like My incomming product urls look like this

--> www.oldSite.com/product/45687/genechip/ --> this is the url of old site

now i want to check the incommimg url comming like this or not in apache mod_rewrite.. i want to nnow how to check inside this rewrite condition.. RewriteCond %{HTTP_HOST} (how to check my incomming url is matching or not here ).. if its true i have to redirect like below --> RewriteRule ^(.*)$ http://www.newSite.com/product/555f4/genechip [L,R=301] ..

    pls help me out from this 

ThanksInAdvance..

Upvotes: 0

Views: 80

Answers (1)

Sdghasemi
Sdghasemi

Reputation: 5608

Add these lines to your .htaccess file:

RewriteEngine On
RewriteRule ^(.*)$ http://newSite.com/$1 [R=301,L]

Upvotes: 1

Related Questions