Skip to content

Instantly share code, notes, and snippets.

@nixilla
Created December 12, 2012 10:37
Show Gist options
  • Select an option

  • Save nixilla/4266781 to your computer and use it in GitHub Desktop.

Select an option

Save nixilla/4266781 to your computer and use it in GitHub Desktop.
<?php
// apps/frontend/modules/default/actions/actions.class.php
class defaultActions extends sfActions
{
public function executeCatchall(sfWebRequest $request)
{
// find your redirectation using $request->getPathInfo()
$redirection = Doctrine_Core::getTable('Redirection')
->findOneByPathInfo($request->getPathInfo());
// this ensures that if there is no specified redirection,
// the old sfError404Exception gets thrown
$this->forward404Unless($redirection);
// redirect
$this->redirect($redirection['redirect_to']);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment