Created
December 18, 2016 16:37
-
-
Save OlegShchavelev/ac57e863cfce4e53b1245a3f13df9880 to your computer and use it in GitHub Desktop.
register.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// set OnHandleRequest OnHandleRequest | |
if ($modx->event->name == 'OnHandleRequest') { | |
$rAlias = $modx->getOption('request_param_alias', null, 'q'); | |
if ( isset ($_REQUEST[$rAlias]) ) { | |
//$_REQUEST[$rAlias] != strtolower($_REQUEST[$rAlias]); | |
if($_REQUEST[$rAlias] != strtolower($_REQUEST[$rAlias])){ | |
$target=strtolower($_REQUEST[$rAlias]); | |
$modx->sendRedirect($target, 0, 'REDIRECT_HEADER', 'HTTP/1.1 301 Moved Permanently'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment