protected static function generate_base_url()
	{
		$base_url = '';
		if(\Input::server('http_host'))
		{
			$base_url .= \Input::protocol().'://'.\Input::server('http_host');
		}
		if (\Input::server('script_name'))
		{
			$common = get_common_path(array(\Input::server('request_uri'), \Input::server('script_name')));
			$base_url .= $common;
		}

		// Add a slash if it is missing and return it
		return rtrim($base_url, '/').'/';
	}