Improved path redirection

This commit is contained in:
Deon George 2011-09-13 21:15:04 +10:00
parent 46b2248c37
commit 6f50463ec7
3 changed files with 2 additions and 6 deletions

View File

@ -130,7 +130,7 @@ Route::set('default/media', 'media(/<file>)', array('file' => '.+'))
* Set the routes. Each route must have a minimum of a name, a URI and a set of
* defaults for the URI.
*/
Route::set('default', '(<controller>(/<action>(/<id>)))', array('id' => '[a-zA-Z0-9_.-]+'))
Route::set('default', '(<controller>(/<action>(/)))(<id>)', array('id' => '.*'))
->defaults(array(
'controller' => 'welcome',
'action' => 'index',

View File

@ -33,9 +33,5 @@ class Controller_Redir extends Controller {
else
$this->response->body(file_get_contents(Kohana::config('config.defaultfile')));
}
public function action_path() {
return $this->action_index();
}
}
?>

View File

@ -26,6 +26,6 @@ class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {
));
// Redirect based on path info
Request::factory()->redirect('redir/path'.$_SERVER['PATH_INFO']);
Request::factory()->redirect('redir/index'.$_SERVER['PATH_INFO']);
}
}