Drupal Commerce 產品 URL 優化 SEO

https://www.drupal.org/project/commerce_product_urls
For each product it provides id parameter, for example:node

http://www.mycommercesite.com/node/1?id=1
http://www.mycommercesite.com/node/1?id=2

as well as sku parameter, for example:app

http://www.mycommercesite.com/node/1?sku=pr1
http://www.mycommercesite.com/node/1?sku=pr2

Sad Original URL = site.com/node/1?id=54
Happy URL :) = site.com/node/1/rueben-sandwich/ide

Use mod_rewrite in your .htaccess file to parse out the elements of the URL. Like this:this

RewriteEngine On //check that in drupal's .htaccess the rewrite engine is on by default
RewriteRule /(.*)/$ node/.*$?id=$1
相關文章
相關標籤/搜索