Skip to content

Instantly share code, notes, and snippets.

@boywhoroared
Last active August 29, 2015 14:14
Show Gist options
  • Save boywhoroared/7c6af94742afb91c113b to your computer and use it in GitHub Desktop.
Save boywhoroared/7c6af94742afb91c113b to your computer and use it in GitHub Desktop.
<?php
// add this to your php.ini
// auto_prepend_file = /path/to/virtual.prepend.php
$http_host = explode('.',$_SERVER['HTTP_HOST']);
$__mod_vhost_alias_fix_doc_root = $_SERVER['DOCUMENT_ROOT'] .
DIRECTORY_SEPARATOR . $http_host[0] .
DIRECTORY_SEPARATOR . 'public';
if (is_dir($__mod_vhost_alias_fix_doc_root)) {
$_SERVER['DOCUMENT_ROOT'] = $__mod_vhost_alias_fix_doc_root;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment