Posts

Showing posts from December, 2010

Avoid duplicate content on Google while your site accessible by both www/non-www URL

Hey Guys,
It has been issued about duplicate content as well as has Google Canonical problem when your site accessible both under  your_domain.com and www.your_domain.com.
For ex.:
www.example.com example.com www.example.com/index.htmlThe socking fact is that,  these all are different URLs. From the search engine perspective, this can cause bit of an issue.
To avoid such problems you can use the following lines in your .htaccess file,
For www version of your web:
RewriteEngine on RewriteCond %{HTTP_HOST} !^www.your_domain.com$ RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]For Non-www version of your web:
RewriteEngine on RewriteCond %{HTTP_HOST} ^www.your_domain\.com$ [NC] RewriteRule ^(.*)$ http://your_domain.com/$1 [R=301,L]Another Way is :
By Canonical Tag:
The Canonical Tag look like this:
<link rel=”canonical” href=”http://www.example.com”/>
You have to simply add this tag inside (HEAD) section and also specify your preferred version of a URL.
This is a great step to…

Speed up Magento Performance

Below is the list of ways to speed up your Magento site. :)


Hosting Environment

Ø  Host only those files that you have to use
Ø  Go to MySql Admin and select all the tables and repair and then optimize them
Ø  Use PHP Accelerator like APC, Zend optimizer , Xcache
     APC – http://pecl.php.net/package/APC
     Xcache – http://xcache.lighttpd.net/
     Note: By default magento stores its cache into file system
    You have to add following code into local.xml
Path:-../app/etc/local.xml
<global>
………………..
<cache>
<backend>apc</backend>
<prefix>MAGE_</prefix>
</cache>
………………….After saved your changes, remember to refresh cache.
Ø  Enable GZIP/DEFLATE compression in .htaccess.Go on this link and enter your magento site address. If it come back with green tick and say http://yoursitename.com is gzipped then skip next step. If not then go on next step.Find following lines in your .htaccess file and replace them with following code<IfModule mod_deflate…

Take order amount in 1.3.2.4 but not in 1.4

Hi Buddies,

If we make module which perform some action on order place time in magento 1.3.2.4. and now same thing want to upgrade on 1.4. . But what we see, no payment amount, currency are shown. . (this was happening only when we take order amount from the checkout session which work on 1.3 but not on 1.4).

It is just because, In magento 1.3.2.4, checkout session was flushed after placing order, but in magento 1.4 version it is flushed on order place time.

Don’t be panic, just take amount, currency, or whatever data you need. . take it from the order object.

$orderId = Mage::getSingleton(‘checkout/session’)->getLastOrderId();
$order = Mage::getSingleton(‘sales/order’)->load($orderId);

//for amount
$order->getBaseGrandTotal()


Cheers :)