Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Moved redirect check to Public_Controller so redirects work for all m…

…odules instead of just pages.
  • Loading branch information...
commit 145f528ad92e2f00ef69ea683d940994cfde24ed 1 parent dd4f735
@jerel jerel authored
View
8 system/pyrocms/core/Public_Controller.php
@@ -8,6 +8,14 @@ public function Public_Controller()
parent::__construct();
$this->benchmark->mark('public_controller_start');
+
+ //check for a redirect
+ $this->load->model('redirects/redirect_m');
+ $uri = trim(uri_string(), '/');
+ if ($redirect = $this->redirect_m->get_from($uri))
+ {
+ redirect($redirect->to);
+ }
Events::trigger('public_controller');
View
7 system/pyrocms/modules/pages/controllers/pages.php
@@ -37,13 +37,6 @@ public function __construct()
*/
public function _remap($method)
{
- $this->load->model('redirects/redirect_m');
- $uri = trim(uri_string(), '/');
- if ($redirect = $this->redirect_m->get_from($uri))
- {
- redirect($redirect->to);
- }
-
// This page has been routed to with pages/view/whatever
if ($this->uri->rsegment(1, '').'/'.$method == 'pages/view')
{
Please sign in to comment.
Something went wrong with that request. Please try again.