Reputation: 333
In my indexAction() I want to redirect to a php file which is located in public folder named login.php.Now When I run this project as giving the url http://example.com:8881/index, it executes.In indexAction I have specified as $form_object = new Application_Form_Login().This form has a submit button and when submit button is clicked,in indexAction() I have specified as
if($form_object->isValid($login_data))
{
$this->_helper->redirector->gotoUrlAndExit('/public/login.php');
}
Because I want to redirect to login.php which is located in public folder.But when I click on submit url changes from http://example.com:8881/index to http://example.com:8881/public/login.php and says an error as Invalid controller specified (public) .I know why this error has occured because in url zend treats the public as controller which is not there.Now this checking should be disabled by the zend so that we can call that php file otherwise in url after the localhost everything will be treated as controller/action.What to do now for above stated requirement?Should I place the login.php file in other folder?What else has to be done?
Please suggest me.Its very much needed.Thanks in advance.
Upvotes: 0
Views: 127
Reputation: 33148
/public/
should never appear in your URLs. Sounds like you simply want to redirect to /login.php:
$this->_helper->redirector->gotoUrlAndExit('/login.php');
If this doesn't work please edit your question to include the contents of your .htaccess file.
Upvotes: 2