{"id":762,"date":"2013-05-24T21:24:09","date_gmt":"2013-05-24T19:24:09","guid":{"rendered":"http:\/\/www.extradrm.com\/?p=762"},"modified":"2013-06-14T14:10:28","modified_gmt":"2013-06-14T12:10:28","slug":"how-to-remove-sessions-id-in-oscommerce-2-3-urls","status":"publish","type":"post","link":"https:\/\/www.extradrm.com\/?p=762","title":{"rendered":"How to remove sessions ID in Oscommerce 2.3 URLs"},"content":{"rendered":"<h2>How to remove or hide session ID from oscommerce URLs<\/h2>\n<p><img data-del=\"avatar\" src='https:\/\/www.extradrm.com\/wp-content\/uploads\/2020\/10\/Michel-haddad-150x150.jpg' class='avatar pp-user-avatar avatar-96wp-user-avatar wp-user-avatar-96 photo ' height='96' width='96'\/> After installing SEO ultimate URL (for example : Ultimate_SEO_URLSv22d_12) and in order to have more friendly URLs, you should remmember to hide\/remove random sessions id generated by spiders access and which can be annoying to your web site indexing.<br \/>\nTo &#8220;<strong>Prevent Spider Sessions<\/strong>&#8220;, you must go to your catalog\/includes\/config.php and be sure that it is like the model below especially for <strong>HTTP_COOKIE_DOMAIN<\/strong> :<\/p>\n<pre>define('HTTP_SERVER', 'http:\/\/mysite.com');\r\n\u00a0 define('HTTPS_SERVER', 'http:\/\/mysite.com');\r\n\u00a0 define('ENABLE_SSL', false);\r\n\u00a0 define('HTTP_COOKIE_DOMAIN', '.mysite.com');\r\n\u00a0 define('HTTPS_COOKIE_DOMAIN', '.mysite.com');\r\n\u00a0 define('HTTP_COOKIE_PATH', '\/shop\/');\r\n\u00a0 define('HTTPS_COOKIE_PATH', '\/shop\/');\r\n\u00a0 define('DIR_WS_HTTP_CATALOG', '\/shop\/');\r\n\u00a0 define('DIR_WS_HTTPS_CATALOG', '\/shop\/');<\/pre>\n<p>After validation, re-set permissions for your file catalog\/includes\/config.php to 444.<br \/>\nNow connect to backend store Admin Pannel and go under Configuration\/sessions :<\/p>\n<p>Make sure that Directory sessions is set to : <strong>\/temp<\/strong><br \/>\n<a href=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2013\/05\/osc_sessions.jpg\"><img loading=\"lazy\" class=\"alignnone size-full wp-image-936\" alt=\"hide oscommerce id sessions\" src=\"http:\/\/www.extradrm.com\/wp-content\/uploads\/2013\/05\/osc_sessions.jpg\" width=\"766\" height=\"280\" srcset=\"https:\/\/www.extradrm.com\/wp-content\/uploads\/2013\/05\/osc_sessions.jpg 766w, https:\/\/www.extradrm.com\/wp-content\/uploads\/2013\/05\/osc_sessions-300x109.jpg 300w\" sizes=\"(max-width: 766px) 100vw, 766px\" \/><\/a><\/p>\n<p>reset the cache<\/p>\n<h2>How to remove session ID appended URLs from the search engine index<\/h2>\n<p>Now let us suppose that you forgot for some reason to do that when launching your shop.<br \/>\nThen you will have several URLs indexed by spiders with the session ID appended. This situation is troublesome and there are a few options to handle referrals sent through the &#8220;wild&#8221; session ID URL.<\/p>\n<p>However, the true solution to the problem is to REMOVE THE SESSION ID&#8217;s from the search engine index.<br \/>\nIn includes\/application_top.php find this code:<\/p>\n<pre>\/\/ include the language translations\r\n  require(DIR_WS_LANGUAGES . $language . '.php');<\/pre>\n<p>Append under it the following code :<\/p>\n<pre>if ( $spider_flag == true ){\r\n  if ( eregi(tep_session_name(), $_SERVER['REQUEST_URI']) ){\r\n   $location = tep_href_link(basename($_SERVER['SCRIPT_NAME']), tep_get_all_get_params(array(tep_session_name())), 'NONSSL', false);\r\n   header(\"HTTP\/1.0 301 Moved Permanently\"); \r\n   header(\"Location: $location\"); \/\/ redirect...bye bye  \r\n  }\r\n }<\/pre>\n<p>This code will redirect the spider to the non-SID URL with a 301 header and over time will remove the session appended URL from the index.<br \/>\nCheers,<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to remove or hide session ID from oscommerce URLs After installing SEO ultimate URL (for example : Ultimate_SEO_URLSv22d_12) and in order to have more friendly URLs, you should remmember to hide\/remove random sessions&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":2841,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[17,24,18],"tags":[177,178,179],"youtube_video":null,"_links":{"self":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/762"}],"collection":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=762"}],"version-history":[{"count":0,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/posts\/762\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=\/wp\/v2\/media\/2841"}],"wp:attachment":[{"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=762"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=762"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.extradrm.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=762"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}