PATH_INFOãåããªãå ´å
Windowsä¸ã®lighttpdã§CGIã¨ãã¦PHPãåä½ãããå ´åãPATH_INFOããã¾ãåå¾ã§ããªãï¼昨日の記事ï¼ã調ã¹ã¦ã¿ãã¨ããããã$_SERVERã«PATH_INFOã¨ãããã¼ãåå¨ããªãããã ãREQUEST_URIã¨SCRIPT_NAMEã¯åå¨ããã®ã§ãããããã®å·®åãåãã°PATH_INFOã¨åãå¤ãåå¾ã§ããã¯ãã
ã¨ããããã§ãé¢æ°ã«ãã¦ã¿ã:
function getPathInfo() { if (array_key_exists('PATH_INFO', $_SERVER)) { return $_SERVER['PATH_INFO']; } $path_info = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['REQUEST_URI']); if (substr_count($path_info, '?') > 0) { // GETãã©ã¡ã¼ã¿ãé¤å» $path_info = preg_replace('/\?.*/', '', $path_info); } return $path_info; }
ããã§ãã¼ã«ã«ç°å¢ãWindowsä¸ã®lighttpdã«ç§»è¡ã§ãããmod_rewriteã使ãå ´åã¯ã.htaccessã使ããªãã®ã§ã«ã¼ã«ãlighttpd.confã«æ¸ããªãã¨ãããªããã©ã