Skip to content
Snippets Groups Projects
Commit 76394ed7 authored by Tim Steiner's avatar Tim Steiner
Browse files

[gh-260] Merging from testing into staging

git-svn-id: file:///tmp/wdn_thm_drupal/branches/drupal-7.x/staging@1342 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 95124949
No related branches found
No related tags found
No related merge requests found
...@@ -4,11 +4,39 @@ ...@@ -4,11 +4,39 @@
* Do so special setup for UNL specific features. * Do so special setup for UNL specific features.
*/ */
function unl_bootstrap() { function unl_bootstrap() {
unl_bootstrap_short_hostname_redirect();
unl_bootstrap_multisite_without_symlinks(); unl_bootstrap_multisite_without_symlinks();
unl_bootstrap_proxy_pass_support(); unl_bootstrap_proxy_pass_support();
unl_bootstrap_mobile_internal_redirect(); unl_bootstrap_mobile_internal_redirect();
} }
/**
* Check that the hostname resolves to an IP Address.
* If it doesn't redirect to <hostname>.unl.edu.
*/
function unl_bootstrap_short_hostname_redirect() {
$hostname = $_SERVER['HTTP_HOST'];
if (gethostbynamel($hostname)) {
// The provided host name is just fine.
return;
}
// Otherwise, try adding .unl.edu.
$hostname .= '.unl.edu';
if (gethostbynamel($hostname)) {
// If its a valid domain, redirect to it.
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$uri = 'https://';
} else {
$uri = 'http://';
}
$uri .= $hostname . $_SERVER['REQUEST_URI'];
header('Location: ' . $uri);
exit;
}
}
/** /**
* Enable the set up of multiple sites without making symbolics links. * Enable the set up of multiple sites without making symbolics links.
* Instead, a few entries in .htaccess and sites.php will be all that is needed. * Instead, a few entries in .htaccess and sites.php will be all that is needed.
......
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