.htaccess and seo-friendly urls

前端 未结 3 462
被撕碎了的回忆
被撕碎了的回忆 2020-12-06 22:58

We have an ecommerce site right now that carries a range of brands. The brand pages carry urls as follows:

  1. http://www..com/catalog/brand/vi
3条回答
  •  感动是毒
    2020-12-06 23:54

    Unless you think the brand names are likely to change then you want to do 2 rewrites, one as a redirect and one internal:

    RewriteRule ^catalog/brand/view?id=2 / [R=301,L]
    RewriteRule ^ /catalog/brand/view?id=2
    

    This means that browsers / spiders will always see the nice URLs while your application will see the real ones.

提交回复
热议问题