Magento SID

如果magento base url 为 goods-pro.com,那么用www.goods-pro.com 访问时,页面中的链接会带有SID,这是为了跨域名访问时,会话不丢失。

为了SEO,就得避免SID,为此goods-pro.com和www.goods-pro.com只能选择一个做base url,把另外一个301跳转到base url。这里我个人比较爱好no-www的方案:

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

Leave a comment

Your email address will not be published. Required fields are marked *