Skip to content
Snippets Groups Projects
Unverified Commit 3c1049ed authored by briancanini's avatar briancanini Committed by GitHub
Browse files

Merge pull request #238 from ASCWebServices/redirect-www

Move www.*.osu.edu redirect after other site-specific redirects
parents 90aebd9f d2bf6b2a
No related branches found
No related tags found
No related merge requests found
......@@ -16,23 +16,6 @@
$variables = array();
}
/**
* Redirect www.*.osu.edu to *.osu.edu
*/
if (!$cli && preg_match('/^www\.(.+)\.osu\.edu$/', $_SERVER["HTTP_HOST"], $matches)) {
$redirect_url = 'https://' . $matches[1] . ".osu.edu" . $_SERVER["REQUEST_URI"];
if (extension_loaded('newrelic')) {
newrelic_name_transaction("redirect");
}
$response_code = 302;
header("HTTP/1.0 $response_code Moved");
header("Location: $redirect_url");
exit();
}
/**
* Pantheon-specific settings
*/
......
......@@ -61,6 +61,22 @@
include $redirects_file;
}
/**
* Redirect www.*.osu.edu to *.osu.edu
*/
if (!$cli && preg_match('/^www\.(.+)\.osu\.edu$/', $_SERVER["HTTP_HOST"], $matches)) {
$redirect_url = 'https://' . $matches[1] . ".osu.edu" . $_SERVER["REQUEST_URI"];
if (extension_loaded('newrelic')) {
newrelic_name_transaction("redirect");
}
$response_code = 302;
header("HTTP/1.0 $response_code Moved");
header("Location: $redirect_url");
exit();
}
/**
* Always install the 'standard' profile to stop the installer from
* modifying settings.php.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment