1

In Magento URL rewrite i create a custom redirection for login URL'customer/account/login' to login.html

But when i click the login link, its again redirect to the 'http://URLBASE/customer/account/login' page instead of 'http://URLBASE/login.html'.

so can you please explain how to redirect my custom URL to the request path. enter image description here

2
  • how did you create the "custom redirection"?
    – Marius
    Commented Jul 20, 2015 at 6:05
  • Back-end admin page see the attached screen for your further reference.
    – senthil
    Commented Jul 20, 2015 at 6:21

3 Answers 3

3

By the way you created the rewrite you will get this outcome.
Each time you call login.html in the browser you will see the login page.
But all the links in the application will still point to customer/account/login.

In order to make the links look like login.html you need to rewrite the method Mage_Customer_Helper_Data::getLoginUrl and make it look something like this (untested code)

public function getLoginUrl()
{
    $params = $this->getLoginUrlParams();
    $params['_direct' => 'login.html'];
    return $this->_getUrl('', $params);
}
1
  • i also create a custom URL for registration URL('customer/account/create') for this also i need to change in code ? so when ever i create a custom URL ,i need to put into the href attribute to manually ?
    – senthil
    Commented Jul 20, 2015 at 10:08
1

Create your custom module

And over-right the function getLoginUrl() class :: Mage_Customer_Helper_Data.

This is an helper class so you need to create the your Helper class :

Create or Over-right magento helper classes.

with following code:

$params = $this->getLoginUrlParams(); $params['customer'] = 'login.html'; return $this->_getUrl('', $params);

1
  • i also create a custom URL for registration URL('customer/account/create') for this also i need to change in code ? so when ever i create a custom URL ,i need to put into the href attribute to manually ? – senthil 1 hour ago
    – senthil
    Commented Jul 20, 2015 at 11:25
0

Currently looking at this screenshot I don't see the dropdown selected for redirect = Yes

or am I missing something here?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.