Remove SID query from Magento URLs

</h3>
<h3><span style="color: #0000ff;"><strong>For removing SID from magento URL,</strong></span></h3>
<h3><span style="color: #0000ff;"><strong> write the below code in the .htaccess file in the root</strong></span></h3>
<span style="text-decoration: underline;"><strong><span style="color: #000000; text-decoration: underline;">If you want to have www part:</span></strong></span>
<p style="text-align: left; padding-left: 30px;"><span style="color: #993366;">RewriteEngine on </span></p>
<p style="text-align: left; padding-left: 30px;"><span style="color: #993366;">RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com$ [NC] </span></p>
<p style="text-align: left; padding-left: 30px;"><span style="color: #993366;">RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]</span></p>
<span style="text-decoration: underline;"><strong><span style="color: #000000; text-decoration: underline;">If you don’t want to have www part:</span></strong></span>
<p style="padding-left: 30px;"><span style="color: #993366;">RewriteEngine on </span></p>
<p style="padding-left: 30px;"><span style="color: #993366;">RewriteCond %{HTTP_HOST} !^yourdomain\.com$ [NC] </span></p>
<p style="padding-left: 30px;"><span style="color: #993366;">RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,L]</span></p>
<p style="padding-left: 30px;">