简体   繁体   English

如何将旧的网址重定向到新的电子商务产品网址?

[英]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 -> www.oldSite.com/product/45687/genechip/--这是旧网站的网址

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] .. 现在,我想检查是否在apache mod_rewrite中这样或类似的incommimg url。我想知道如何检查此重写条件内的内容。RewriteCond%{HTTP_HOST}(如何在此处检查我的传入url是否匹配)。 。如果是真的,我必须像下面一样重定向-> 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: 将这些行添加到您的.htaccess文件中:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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