Posts Tagged "redirection"

Redirect from non-www to www in CakePHP

How to redirect from non-www to www in CakePHP? Put the following code into .htaccess in main directory <IfModule mod_rewrite.c> RewriteCond %{HTTPS} !=on RewriteCond %{HTTP_HOST} !^www\..+$ [NC] RewriteCond %{HTTP_HOST} !=localhost [NC] RewriteCond %{HTTP_HOST} !=127.0.0.1 RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </IfModule> <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^$ app/webroot/ [L] RewriteRule (.*) app/webroot/$1 [L] </IfModule> Shashi Dhar KumarShashi Dhar Kumar Experience in Web/software development including client server and implementation using PHP, XML, MySQL and SQL Server. Experience of working on Apache, Linux projects,…

Read More

Magento redirect customer after registration

Go to customer accountcontroller find _welcomeCustomer method. file location must be like app/code/core/Mage/Customer/controllers/AccountController.php Search for protected function _successProcessRegistration(Mage_Customer_Model_Customer $customer) function at accountcontroller.php file and change following: $url = $this->_getUrl(‘*/*/index’, array(‘_secure’ => true)); to $url = Mage::getUrl(‘thank-you’, array(‘_secure’=>true)); OR Search for $successUrl = $this->_getUrl(‘*/*/index’, array(‘_secure’ => true)); replace this code with your URL $successUrl = $this->_getUrl(‘thank-you’, array(‘_secure’ => true)); And don’t forget to create Thank You Page with URL Key as thank-you or you can change with your desired url, but…

Read More

301 redirect with htaccess

How to redirect web based page with .htaccess Following are the code to paste (be careful to write on .htaccess it can be messed up whole website if anything goes wrong) into .htaccess file 301 redirection for any domain : RewriteEngine On RewriteCond %{HTTP_HOST} !^www.olddomain.com RewriteRule ^(.*)$ http://www.newdomain.com [R=301,L] newdomainRewriteRule ^$ http://www.newdomain.com [R=301,L] RewriteRule ^index.htm$ http://www.newdomain.com [R=301,L] RewriteRule ^index.php$ http://www.newdomain.com [R=301,L] RewriteRule ^index.html$ http://www.newdomain.com [R=301,L] RewriteRule ^index.shtml$ http://www.newdomain.com [R=301,L] RewriteRule ^index.asp$ http://www.newdomain.com [R=301,L] RewriteRule ^default.asp$ http://www.newdomain.com [R=301,L] RewriteRule ^index.aspx$ http://www.newdomain.com…

Read More