0

我有 Google 索引的页面,例如 sample.com/product-detail.cfm?id=532323。这些页面有很多。这些页面不再存在,我想将它们全部重定向到我们新站点的主页。谁能建议如何重定向所有页面而不必单独执行每个页面?

4

1 回答 1

0

All of them should go to the home page

Then you can just check for /product-detail.cfm and ignore the id= param in the query string. You can do this with either mod_alias or mod_rewrite by adding these directives in the htaccess file in your document root:

Using mod_alias:

Redirect 301 /product-detail.cfm /

Using mod_rewrite:

RewriteEngine On
RewriteRule ^product-detail.cfm$ / [L,R=301]
于 2012-12-21T02:46:34.370 回答