--- php-4.0.6-orig/sapi/apache/mod_php4.c Wed May 16 20:26:08 2001 +++ php-4.0.6/sapi/apache/mod_php4.c Sun Sep 16 12:24:42 2001 @@ -440,6 +440,35 @@ return mimetype; } +static void php_get_request_handler(request_rec *r, char **target) +{ + HashTable *per_dir_conf; + php_per_dir_entry *per_dir_entry; + char *filename; + + if (!(per_dir_conf = get_module_config(r->per_dir_config, &php4_module))) + return; + + if (zend_hash_find(per_dir_conf, "request_handler", sizeof("request_handler")-1, + (void **)&per_dir_entry) == SUCCESS) + { + if (!ap_os_is_path_absolute(per_dir_entry->value)) + { + char *dirnam = ap_pstrdup(r->pool, r->filename); + char *x = strrchr(dirnam, '/'); + + if (x != NULL) + *x = 0; + filename = ap_make_full_path(r->pool, dirnam, per_dir_entry->value); + } + else + filename = ap_pstrdup(r->pool, per_dir_entry->value); + + *target = filename; + } + +} + static int send_php(request_rec *r, int display_source_mode, char *filename) { int retval; @@ -531,6 +560,8 @@ php_save_umask(); add_common_vars(r); add_cgi_vars(r); + + php_get_request_handler(r, &r->filename); init_request_info(SLS_C); apache_php_module_main(r, display_source_mode CLS_CC ELS_CC PLS_CC SLS_CC);