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} != 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} !^ RewriteRule ^(.*)$ [R=301,L] newdomainRewriteRule ^$ [R=301,L] RewriteRule ^index.htm$ [R=301,L] RewriteRule ^index.php$ [R=301,L] RewriteRule ^index.html$ [R=301,L] RewriteRule ^index.shtml$ [R=301,L] RewriteRule ^index.asp$ [R=301,L] RewriteRule ^default.asp$ [R=301,L] RewriteRule ^index.aspx$…

Read More