简体   繁体   中英

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..

Add these lines to your .htaccess file:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM