Improved path redirection
This commit is contained in:
parent
46b2248c37
commit
6f50463ec7
@ -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
|
* Set the routes. Each route must have a minimum of a name, a URI and a set of
|
||||||
* defaults for the URI.
|
* 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(
|
->defaults(array(
|
||||||
'controller' => 'welcome',
|
'controller' => 'welcome',
|
||||||
'action' => 'index',
|
'action' => 'index',
|
||||||
|
@ -33,9 +33,5 @@ class Controller_Redir extends Controller {
|
|||||||
else
|
else
|
||||||
$this->response->body(file_get_contents(Kohana::config('config.defaultfile')));
|
$this->response->body(file_get_contents(Kohana::config('config.defaultfile')));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function action_path() {
|
|
||||||
return $this->action_index();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -26,6 +26,6 @@ class HTTP_Exception_404 extends Kohana_HTTP_Exception_404 {
|
|||||||
));
|
));
|
||||||
|
|
||||||
// Redirect based on path info
|
// Redirect based on path info
|
||||||
Request::factory()->redirect('redir/path'.$_SERVER['PATH_INFO']);
|
Request::factory()->redirect('redir/index'.$_SERVER['PATH_INFO']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user