Redirect URL from AJAX Calls

Posted by Vincent on Stack Overflow See other posts from Stack Overflow or by Vincent
Published on 2010-05-26T16:50:47Z Indexed on 2010/05/26 18:21 UTC
Read the original article Hit count: 225

Filed under:
|
|

All,

I have an application written in Zend MVC Framework. So, naturally all regular requests and ajax requests go through /public/index.php. I want my application to support maintenance mode. So, in my index.php file, I have the following code:

if( Zend_Registry::get('config')->maintenance == 'true' )
{
    header('Location:/maintenance.php');
}

The issue is, when ajax requests are called they render servermaintenance.php inside the page instead of redirecting to this page. How can I make sure it gets redirected instead of getting rendered?

Thanks

© Stack Overflow or respective owner

Related posts about mvc

Related posts about zend-framework