diff options
author | Tom Adams <tom@holizz.com> | 2009-07-30 20:55:33 +0100 |
---|---|---|
committer | Tom Adams <tom@holizz.com> | 2009-08-04 01:24:30 +0100 |
commit | 961d2a812f4f463d48385fe78412a116fbfe71f3 (patch) | |
tree | 10da53905bdb917acd2992de40d4b9e598d2d47e /index.php | |
parent | 06a41d4516182fb141ce9171ea79a52257c45e8b (diff) |
lighttpd rewrites now possible in other directories.
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -113,14 +113,15 @@ function main() $_lighty_url = @parse_url($_lighty_url); if ($_lighty_url['path'] != '/index.php' && $_lighty_url['path'] != '/') { - $_SERVER['QUERY_STRING'] = 'p='.substr($_lighty_url['path'], 1); + $_lighty_path = preg_replace('/^'.preg_quote(common_config('site','path')).'\//', '', substr($_lighty_url['path'], 1)); + $_SERVER['QUERY_STRING'] = 'p='.$_lighty_path; if ($_lighty_url['query']) $_SERVER['QUERY_STRING'] .= '&'.$_lighty_url['query']; parse_str($_lighty_url['query'], $_lighty_query); foreach ($_lighty_query as $key => $val) { $_GET[$key] = $_REQUEST[$key] = $val; } - $_GET['p'] = $_REQUEST['p'] = substr($_lighty_url['path'], 1); + $_GET['p'] = $_REQUEST['p'] = $_lighty_path; } } $_SERVER['REDIRECT_URL'] = preg_replace("/\?.+$/", "", $_SERVER['REQUEST_URI']); |