Redirect old website / domain to new domain using htaccess

Posted by Damodar Bashyal on May 27, 2013

 

Today's task was to redirect all pages from an old domain to new domain except one page (google verification file). All pages including any query string should be stripped out and redirect to only homepage of new domain with out any query string.

More»

Magento get current url of a page

Posted by Damodar Bashyal on May 13, 2013

 

Magento core url helper allows you to get current url.

To get current url in magento you just need one line of code as below:

ref: public function getCurrentUrl()

$magentoCurrentUrl = Mage::helper('core/url')->getCurrentUrl();

You can also get current url as base64 encoded url as:

More»

Magento Redirect Functions

Posted by Damodar Bashyal on May 13, 2013

 

Magento core provides some built-in redirect functions to redirect url to new urls. Let's check few of them below:

From any of your Magento controller you can redirect user to any url as defined below. If you want to use redirect function in your magento observer model check this Technooze_T404 extension which I created to handle 404 issue in multi-store magento installation as defined here - stackoverflow question.

More»