Skip to content

Instantly share code, notes, and snippets.

@bryanwillis
Created August 18, 2013 06:03
Show Gist options
  • Save bryanwillis/6260138 to your computer and use it in GitHub Desktop.
Save bryanwillis/6260138 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