Version: current

     1 <?php
     2  // проверк наличия редиректа и использование его
     3 class ControllerRedirectExtension extends Extension {
     4     function updateAlternateURL(& $alternateURL, & $request) {
     5         $url = ($request->getURL()) ? $request->getURL() : $_SERVER['REDIRECT_URL'];
     6         $url = Convert::raw2sql(RedirectEntry::clear_url($url));
     7         if ($redirect = DataObject::get_one('RedirectEntry', "OldURL = '{$url}'")) {
     8             $alternateURL = $redirect->NewURL;
     9         }
    10     }
    11 }

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -