Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Redirect to homepage after customer account creation or address add/edit
 
pixelpusher
Sr. Member
 
Avatar
Total Posts:  135
Joined:  2008-04-23
SoCal
 

Upon the creation of a new account the customer is redirected to the main homepage rather than the account dashboard. This also happens when new address’s are created. But not when deleted. When “my account” is clicked on the confirmation text appears at the top (The address was successfully saved, etc) so the info is being saved in DB, but then redirected to the wrong place. This happens in IE7 and FF3.

I have a “fresh install (1.1.1)” where this works perfectly, but not in my production site (1.1.1 updated from 1.0) . I’ve copied layout/customer.xml, the entire template/customer folder, and the js folder to the production site but it still redirects to the homepage. Cache is off, and catalog rewrites have been refreshed.

thanks in advance
any insight is much appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pixelpusher
Sr. Member
 
Avatar
Total Posts:  135
Joined:  2008-04-23
SoCal
 

upgraded to 1.1.2 still no help.
replaced app/code/Mage with fresh install version. Still no help.

anyone? any ideas?

 
Magento Community Magento Community
Magento Community
Magento Community
 
lotusseedsD
Mentor
 
Avatar
Total Posts:  1144
Joined:  2007-08-31
 

See this thread: http://www.magentocommerce.com/boards/viewthread/9210/

p/s. is that photo really you? Man, I cannot concentrate on my work you know, your photo is distracting me from reading your problem - if you don’t get response from the community, don’t blame the forum or magento team, but consider changing your photo smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
pixelpusher
Sr. Member
 
Avatar
Total Posts:  135
Joined:  2008-04-23
SoCal
 

Thanks for the thread although my problem seems a bit different.
I do not have “need to confirm” enabled.
As far as I can tell there seems to be some problem with getSaveUrl being reported incorrectly. ( much like your problem with getBackUrl in the bugtracker )

I will consider changing my photo. I am just a huge fan of firefox and adore the “firefox girl” Google her for more information.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pixelpusher
Sr. Member
 
Avatar
Total Posts:  135
Joined:  2008-04-23
SoCal
 

well I’ve narrowed this down to the database. I took the fresh install (1.1.1 updated to 1.1.2) and imported my production sites database. It used to work on the fresh install until the import of the production database. I’ll be digging around for a while.

If anyone has any insight as to what tables to look at to fix this I’d greatly appreciate it.

 
Magento Community Magento Community
Magento Community
Magento Community
 
pixelpusher
Sr. Member
 
Avatar
Total Posts:  135
Joined:  2008-04-23
SoCal
 

Still looking.

Think it might be eav_attribute table. But I haven’t been able to pinpoint the problem yet. The problem happens in IE and Firefox but I just thought what the hell and tried safari. to my surprise it worked! If anyone could give me insight here I’d appreciate it. I have no clue why this problem would be browser specific...?

I would really hate to have to start over because of a stupid problem like this…

 
Magento Community Magento Community
Magento Community
Magento Community
 
georgek
Jr. Member
 
Total Posts:  23
Joined:  2008-01-03
 

I’ve got the same problem.

Another thing is that if you set “Use Secure URLs in Frontend” to No, it works......

 
Magento Community Magento Community
Magento Community
Magento Community
 
nikefido
Guru
 
Avatar
Total Posts:  481
Joined:  2008-07-11
New Haven, CT
 

I’ve run across this problem of getting redirected to the home page when there were certain coding errors - seemed that redirect was set up as a fail safe. I believe it’s browser independent.

Most likely culprit is
1) editing of the dashboard you may have done that is creating an error when people go to their dashboard
2) some part of the code that happens when the user clicks the submit button after filling out their info

Did you edit stuff at any of these points? Logic or design?

You might also be interested in turning on debug mode and and developer mode (depending on magento version) along with checking out apache error logs (you might not find anything in the apache logs since the exception is most likely caught and handled by Magento, and the told to redirect to the home page).

Here’s a thread with some info on debugging / location of error logs:
http://www.magentocommerce.com/boards/viewthread/6996/
(Check for Moshe’s post)

 
Magento Community Magento Community
Magento Community
Magento Community
 
pixelpusher
Sr. Member
 
Avatar
Total Posts:  135
Joined:  2008-04-23
SoCal
 

Yeah after revisiting the problem I wanted to clarify that it only exists when editing address’s and upon account creation.

I’ve been looking in app/code/core/Mage/customer and at the eav_attribute table but I’m still unable to fix the problem.

I have not made any modifications to the code or design ( the only thing is a left callout block with an image, and I’ve tried removing it but still redirects the same way)
and as stated before a fresh install that doesn’t have the problem suddenly has the problem after the import of the production database

the “code” that manages this redirect is here:
app/code/core/Mage/Customer/controllers/AddressController.php

line 120 is the success redirect.

even though that would just be a workaround, changing the redirect address has no effect. It still forwards to the homepage no matter whats written there.

Even if the log is enabled nothing in created in var/log after this redirect error.
Also nothing in php error logs

 
Magento Community Magento Community
Magento Community
Magento Community
 
pixelpusher
Sr. Member
 
Avatar
Total Posts:  135
Joined:  2008-04-23
SoCal
 

ok I have a work around but its really not ideal, and I’m sure theres many places it needs to be.

I’d rather figure out the problem than post a band-aid that will most likely either revert or botch future installations… so PLEASE don’t think this is the solution to the problem.

I’m only posting this to further the discussion it is NOT intended as a solution. seems to a problem with

app/code/core/Mage/Customer/controllers/AddressController.php (also AccountController.php)
line120

$this->_redirectSuccess(Mage::getUrl('*/*/index', array('_secure'=>true)));

when changed to
line120

$this->_redirect('*/*/');

it works. however there are other places this needs to be changed ( ie error redirect url, account creation success url / error url)

PLEASE DON"T USE THIS SOLUTION.... FIND THE ROOT OF THE PROBLEM!!!

as far as I can tell this happens in stores that have been updated from 1.0 and has something to do with _redirectSuccess not functioning correctly.

 
Magento Community Magento Community
Magento Community
Magento Community
 
georgek
Jr. Member
 
Total Posts:  23
Joined:  2008-01-03
 

I’ve found where the problem lies, but I’m unsure how to correct it properly. If anyone can help I’d be grateful.

The problem is in app\code\core\Mage\Core\Controller\Varien\Action.php in the _isUrlInternal function.

This function checks to see whether the base url is part of the url passed to it using strpos.
If it isn’t it returns a false and redirects to the home page rather than the customer dashboard/address page.

My problem is the customer area is secure therefore it’s looking for the base url of “http://www.bopbaloo.com/”
within the secure url of “https://www.bopbaloo.com/customer/account/create/”

This does not match because of http vs https.

That’s why if I turn off the secure frontend it works as it’s comparing “http://www.bopbaloo.com/” within
“http://www.bopbaloo.com/customer/account/create/”

Any ideas how to fix this?

 
Magento Community Magento Community
Magento Community
Magento Community
 
georgek
Jr. Member
 
Total Posts:  23
Joined:  2008-01-03
 

Well I’m no expert so forgive my php, but this is the code I’ve inserted to fix it in the _isUrlInternal function in Action.php:

protected function _isUrlInternal($url)
/* New Code */
    
{
         
if (strpos($url'https') !== false{
             $url 
'http'.substr($url,5);
         
}
/*New Code */

         
if (strpos($url'http') !== false
         
&& strpos($urlMage::app()->getStore()->getBaseUrl()) !== 0{
         
return false;
         
}
         
         
return true;
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
pixelpusher
Sr. Member
 
Avatar
Total Posts:  135
Joined:  2008-04-23
SoCal
 

Well that solution works for me too, and should suffice until a real fix is out. But the real question is why does this function work perfectly in a 1.1.2 store, but needs to be altered for an upgraded 1.0 ->1.1.2 store?

 
Magento Community Magento Community
Magento Community
Magento Community
 
rsskga
Jr. Member
 
Avatar
Total Posts:  30
Joined:  2008-02-15
San Francisco
 

Rather than editing that function, I just set up a RewriteRule to force https so that it will always match no matter what page someone is coming from and going to.

I’m not very experienced with https though… this is the first time I’ve had an SSL cert… is there any reason that solving this problem in this way is a bad idea?

 
Magento Community Magento Community
Magento Community
Magento Community
 
sean US
Member
 
Total Posts:  58
Joined:  2008-10-01
 

I have a problem with the redirect. I am using 1.4.0.1. After the customer logs in, he gets redirected to the dashboard even though the setting in the back end says:
Redirect Customer to Account Dashboard after Logging in: “No”
how can i fix this situation, its very urgent.

 
Magento Community Magento Community
Magento Community
Magento Community
 
newmage
Jr. Member
 
Total Posts:  7
Joined:  2010-10-18
 

Has there been any solution to this for 1.4.1.1 ?

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2