Remove Session IDs (SID) From URL In Magento

If you’re having problems with Google and other search engines indexing the pages of your Magento Commerce site with session id’s or SID’s, (they look something like this, note the bold SID: http://www.yourdomain.com/service-truck-hardware/d-ring handles.html?SID=ck5gk65tbs0jeml5ebb9flvk27&limit=9&order=manufacturer&dir=asc), here’s the way we fixed it. You may have to try one method or the other. One way worked on one of our websites, the other way worked on the other.

In your .htaccess file, you can try this code:

## remove SID from get request query string
RewriteCond %{request_method} ^GET$
RewriteCond %{QUERY_STRING} ^(.+&)?SID=[\w]*&(.+)?$ [NC]
RewriteRule
^(.*)$ /$1?%1%2 [R=301,L,NE]

and if that doesn’t work, try this code:

## remove SID from get request query string
RewriteCond %{request_method} ^GET$
RewriteCond %{QUERY_STRING} ^((.+)&)?SID=[\w]*$ [NC]
RewriteRule
^(.*)$ /$1?%2 [R=301,L,NE]

Hope that helps!

Remove the ?___store=default from the URL In Magento

How do you remove the ?___store=default from the URL In Magento?

Open Link.php in app/code/core/Mage/Catalog/Block/Widget/Link.php

GOTO Line 91: $this->_href = $this->_href . $symbol .”___store=” . $store->getCode();

And change it to: $this->_href = $this->_href;

Set the max pop3 connections simutaneously for one ip

If you have more than 4 email accounts on a single domain, it’s very common you won’t be able to retrieve email from all of your accounts. By default, many servers have a MAXPERIP=4 setting in the pop3d file on the server. If you are having this problem, go to the /etc/courier-imap/ directory and vi the pop3d file. Find the line that reads MAXPERIP=4 and edit that line to read MAXPERIP=40. Escape out and :wq the edit.

Next restart the service with: /etc/init.d/courier-imap restart

Problem of too many simulataneous email connections should now be solved.

How To Make A Custom Page Not Found Page for Opencart

Making a custom “Page Not Found” page for Opencart is actually fairly simple once you figure it out. The only real tricky part to this is that you have to modify three files to make it work instead of just two files like you might use in osCommerce.

It’s fairly straightforward that you would modify your language page which is here:

/catalog/language/english/error/not_found.php

What we did was under the line:

// Text

$_['text_error'] = ‘The work truck hardware and equipment page you requested cannot be found.’;

we added a line like this one:

// Text Page

$_['text_page'] = ‘The page you requested cannot be found. WorkTruck Outfitters was completely rebuilt on October 14th, 2012. If you are seeing this page, you may have been brought here by a search engine or one of your bookmarks. We apologize for the inconvenience! That exact url does not exist.<br><b>There are quite a few options to find the work truck product you were looking for.</b><br>First off, you can call us. 877-360-7278.<br> You can try using our search box in the top left area of our web page.<br>You may find our sitemap very helpful. <li><a href=”index.php?route=information/sitemap”><b>Work Truck Outfitters Sitemap</b></a></li><br> Or, you may want to try one of these popular links:<br><br><li><a href=”backup-cameras-trucks”><b>Backup Cameras For Trucks</b></a></li><li><a href=”air-compressors-trucks”><b>Air Compressors For Trucks</b></a></li><li><a href=”crane-pallet-forks”><b>Crane Pallet Forks</b></a></li><li><a href=”jump-start-equipment/goodall-startalls”><b>Goodall StartAlls</b></a></li><li><a href=”hardware-work-trucks”><b>Hardware For Work Trucks</b></a></li><li><a href=”outrigger-pads”><b>Outrigger Pads For Crane Trucks</b></a></li><li><a href=”power-inverters-for-trucks”><b>Power Inverters For Trucks</b></a></li><li><a href=”utility-body-bed-covers”><b>Utlity Body Bed Covers</b></a></li><li><a href=”warn-winches”><b>Warn Winches and Hoists</b></a></li><li><a href=”wheel-chocks”><b>Wheel Chocks</b></a></li>’;

That adds the text and links in the “Page Not Found” page. But to call that line into action, you have to call it in the template page found here:

/catalog/view/theme/default/template/error/not_found.tpl

So, under this line:

<div class=”content”><?php echo $text_error; ?></div>

We added this line:

<div class=”content”><?php echo $text_page; ?></div>

In osCommerce, that’s all it would have taken. But in Opencart, we have to do one more edit to make this work. If not, you’re going to get an “Undefined variable” error message that looks like this:

Notice: Undefined variable: text_page in /yoursite.com/httpdocs/catalog/view/theme/default/template/error/not_found.tpl on line 10

So, we now need to modify one more line:

In /catalog/controller/error/not_found.php

Find the line that reads:

$this->data['text_error'] = $this->language->get(’text_error’);

and add under that this:

$this->data['text_page'] = $this->language->get(’text_page’);

That’s it. Now when a visitor get’s your “Page Not Found” page on your Opencart site, they’ll be able to get the full message you want to get accross so they can find the product they were looking for.

// Text
$_['text_error']    = ‘The work truck hardware and equipment page you requested cannot be found.’;