26

I have installed Magento 1.9 on domain say abc.com and created a new website having URL xyz.abc.com from admin

System -> Manage Stores

Now what I have done is created a new sub domain xyz.abc.com and pointed to original magento installation.

Whenever I visit to xyz.abc.com it works fine. But the links that are generated on that page have a query string parameter SID like abc.com?SID=sdfskjdf45ssdf/somepage.

Now I want replace abc.com?SID=sdfskjdf45ssdf/somepage with xyz.abc.com/somepage.

8

You need to configure the base url and base link url for your subdomain store.
Go to system->configuration->web->unsecure (and secure if needed) and fill in http://xyz.abc.com for the base url and base link url.
You are getting this because when running the subdomain store you are actually running the main domain store and every link in the page will get you back to the main domain store.

  • In subdomain, I have http://xyz.abc.com format only but still I see ?__SID=U appended to my main domain url. – Mr_Green Feb 11 '15 at 6:17
  • system->configuration->web->Session Validation Settings->Use SID on Frontend: NO – matinict Jun 2 '18 at 6:51
51

Go to Admin>System > Configuration > Web > Session Validation Settings .

Then disable config Use SID on Frontend = No

6

Many people wonder why sometimes the SID part appears in their Magento URLs. This is when your URL has additional SID query usually at the end. Take a look at the image. The curiosity is that it does not appear always. What is the most common scenario it happens? You didn’t access the site with the same domain variant you entered as your “Base URL” in your System> Configuration> Web interface.

When you decide to launch the site, you have to decide whether you will market http://www.domain.com/ URL or http://domain.com/. This is an important decision and you shouldn’t change your mind quite often. Search engines usually treat those two URLs as a different sites and therefore the Page Rank potential can be split between those two URLs. So, think about whether you will use www or not and stick by this decision.

Once you decided, go to your System> Configuration> Web interface and enter the desired form to “Base URL” field. When you access the site you will notice that there are no “SID”s when the URL matches the value from “Base URL” field and they appear when it does not.

Now, we want the ability that the site redirects to proper URL once accessed. Someone can place a wrong link to some forum or blog. We don’t want those links to lead to improper URL and we don’t want SIDs to appear to those visitors. Most important: We don’t want that search engines index the URLs with SIDs.

The solution is simple. Go to your .htaccess fine and find the line that says

RewriteEngine on If you want to have www part:

RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.yourdomain\.com$ [NC] RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L] If you don’t want to have www part:

RewriteEngine on RewriteCond %{HTTP_HOST} !^yourdomain\.com$ [NC] RewriteRule ^(.*)$ http://yourdomain.com/$1 [R=301,L]

Source From Incho.

6
    $params = array(
        '_nosid' => true
    );

    $url = Mage::getUrl('*/*/*', $params);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.