Skip to content

Instantly share code, notes, and snippets.

  • Save OlegShchavelev/ac57e863cfce4e53b1245a3f13df9880 to your computer and use it in GitHub Desktop.
Save OlegShchavelev/ac57e863cfce4e53b1245a3f13df9880 to your computer and use it in GitHub Desktop.
register.php
<?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