I have three contact-us forms that are CMS pages. They are on separate websites, and they all have different URL keys. The CMS pages have their own phtml forms but use the same controller action (form_action="/contacts/index/post"
) for posting as defined in the CMS.
Current behavior:
Each of these forms submit just fine, but, after submission, they are redirected to the /contacts/index/
(through $this->_redirect('*/*/')
) and the redirected pages are not what the customer started from, of course.
Desired behavior:
I would like the redirected page to be the same form page that the customer starts from. What's one of the cleanest and make-sense way to do this? Should I create an extension with a controller that basically does what the Mage_Contacts
module does, but with a different redirect logic?
$this->_redirect('*/*/');
in your controller. I think that is the best option.$this->_redirectReferer()
instead of$this->_redirect('*/*/')
contacts/index/post
with the redirect to the referer`) or approach it differently? I'm just trying to get an idea of how people would approach and solve this kind of issues.