Project

General

Profile

« Previous | Next » 

Revision 7956

web/vegpath/index.php: $alias: Use HTTP_HOST and SCRIPT_NAME so the alias doesn't need to be hardcoded

View differences:

index.php
1 1
<?php
2 2
require_once dirname(__FILE__)."/util.php";
3 3

  
4
$self_dir = ensure_suffix("/", dirname($_SERVER["SCRIPT_NAME"]));
5

  
4 6
# config
5
$alias = "path.vg/";
7
$alias = $_SERVER["HTTP_HOST"].$self_dir;
6 8
#$alias = "j.mp/vegpath#";
7 9

  
8 10
function by_prefix($url, $main_url=null)
......
16 18
}
17 19

  
18 20
$h_level = 5;
19
$self_dir = dirname($_SERVER["SCRIPT_NAME"]);
20 21
# instead of PATH_INFO, to support the Apache ErrorDocument directive
21 22
$rel_fs_path = rm_prefix($self_dir, $_SERVER["REQUEST_URI"]);
22 23
$path = parse_dot_path($rel_fs_path);

Also available in: Unified diff