From a388b842278920701ab164f78423e7239c2ff84b Mon Sep 17 00:00:00 2001 From: Ken Coar Date: Tue, 14 Apr 2015 22:02:22 +0000 Subject: [PATCH] Related to httpd-doc bug 53530; uniform use of quotation marks. Put quotation marks around most arbitrary-text or filesystem strings for directives: * {Alias,Redirect,Proxy*}{,Match} * <{Directory,Files,Location}{,Match}> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1673563 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/developer/modguide.xml | 162 ++++++++++++------------- docs/manual/dns-caveats.xml | 10 +- docs/manual/env.xml | 2 +- docs/manual/expr.xml | 4 +- docs/manual/handler.xml | 2 +- docs/manual/howto/access.xml | 6 +- docs/manual/howto/auth.xml | 22 ++-- docs/manual/howto/cgi.xml | 8 +- docs/manual/howto/htaccess.xml | 40 +++--- docs/manual/howto/public_html.xml | 2 +- docs/manual/misc/perf-tuning.xml | 16 +-- docs/manual/misc/security_tips.xml | 12 +- docs/manual/mod/core.html.en | 52 ++++---- docs/manual/mod/core.xml | 62 +++++----- docs/manual/mod/mod_access_compat.xml | 8 +- docs/manual/mod/mod_actions.xml | 10 +- docs/manual/mod/mod_alias.xml | 89 +++++++------- docs/manual/mod/mod_allowmethods.xml | 4 +- docs/manual/mod/mod_auth_basic.xml | 16 +-- docs/manual/mod/mod_auth_digest.xml | 6 +- docs/manual/mod/mod_auth_form.xml | 32 ++--- docs/manual/mod/mod_authn_anon.xml | 4 +- docs/manual/mod/mod_authn_core.xml | 16 +-- docs/manual/mod/mod_authn_dbd.xml | 2 +- docs/manual/mod/mod_authn_socache.xml | 2 +- docs/manual/mod/mod_authnz_fcgi.xml | 8 +- docs/manual/mod/mod_authnz_ldap.xml | 4 +- docs/manual/mod/mod_authz_core.xml | 22 ++-- docs/manual/mod/mod_authz_dbd.xml | 8 +- docs/manual/mod/mod_authz_dbm.xml | 16 +-- docs/manual/mod/mod_authz_owner.xml | 10 +- docs/manual/mod/mod_autoindex.xml | 6 +- docs/manual/mod/mod_cache.xml | 30 ++--- docs/manual/mod/mod_charset_lite.xml | 4 +- docs/manual/mod/mod_data.xml | 2 +- docs/manual/mod/mod_dav.xml | 16 +-- docs/manual/mod/mod_dav_fs.xml | 4 +- docs/manual/mod/mod_deflate.xml | 28 ++--- docs/manual/mod/mod_dialup.xml | 8 +- docs/manual/mod/mod_dir.html.en | 10 +- docs/manual/mod/mod_dir.xml | 12 +- docs/manual/mod/mod_example_hooks.xml | 4 +- docs/manual/mod/mod_ext_filter.xml | 8 +- docs/manual/mod/mod_filter.xml | 4 +- docs/manual/mod/mod_info.xml | 6 +- docs/manual/mod/mod_ldap.xml | 54 ++++----- docs/manual/mod/mod_log_config.xml | 10 +- docs/manual/mod/mod_log_debug.xml | 6 +- docs/manual/mod/mod_lua.xml | 32 ++--- docs/manual/mod/mod_macro.xml | 16 +-- docs/manual/mod/mod_mime.xml | 12 +- docs/manual/mod/mod_proxy.xml | 140 ++++++++++----------- docs/manual/mod/mod_proxy_ajp.xml | 14 +-- docs/manual/mod/mod_proxy_balancer.xml | 30 ++--- docs/manual/mod/mod_proxy_express.xml | 4 +- docs/manual/mod/mod_proxy_fcgi.xml | 20 +-- docs/manual/mod/mod_proxy_scgi.xml | 8 +- docs/manual/mod/mod_proxy_wstunnel.xml | 4 +- docs/manual/mod/mod_ratelimit.xml | 2 +- docs/manual/mod/mod_reflector.xml | 4 +- docs/manual/mod/mod_rewrite.xml | 26 ++-- docs/manual/mod/mod_session.xml | 2 +- docs/manual/mod/mod_speling.xml | 2 +- docs/manual/mod/mod_ssl.xml | 54 ++++----- docs/manual/mod/mod_status.xml | 2 +- docs/manual/mod/mod_substitute.xml | 16 +-- docs/manual/mod/mod_vhost_alias.xml | 18 +-- docs/manual/platform/windows.xml | 16 +-- docs/manual/rewrite/access.xml | 54 ++++----- docs/manual/rewrite/advanced.xml | 26 ++-- docs/manual/rewrite/avoid.xml | 12 +- docs/manual/rewrite/flags.xml | 90 ++++++++------ docs/manual/rewrite/intro.xml | 24 ++-- docs/manual/rewrite/proxy.xml | 14 +-- docs/manual/rewrite/remapping.xml | 139 +++++++++++---------- docs/manual/rewrite/rewritemap.xml | 40 +++--- docs/manual/rewrite/tech.xml | 6 +- docs/manual/rewrite/vhosts.xml | 40 +++--- docs/manual/sections.xml | 60 ++++----- docs/manual/ssl/ssl_faq.xml | 12 +- docs/manual/ssl/ssl_howto.xml | 40 +++--- docs/manual/urlmapping.xml | 22 ++-- docs/manual/vhosts/examples.xml | 76 ++++++------ docs/manual/vhosts/ip-based.xml | 12 +- docs/manual/vhosts/mass.xml | 44 +++---- docs/manual/vhosts/name-based.xml | 4 +- 86 files changed, 1030 insertions(+), 976 deletions(-) diff --git a/docs/manual/developer/modguide.xml b/docs/manual/developer/modguide.xml index 28c8242402..5b4a4dd089 100644 --- a/docs/manual/developer/modguide.xml +++ b/docs/manual/developer/modguide.xml @@ -337,22 +337,22 @@ Let's try out some of these variables in another example handler:
static int example_handler(request_rec *r) { /* Set the appropriate content type */ - ap_set_content_type(r, "text/html"); + ap_set_content_type(r, "text/html"); /* Print out the IP address of the client connecting to us: */ - ap_rprintf(r, "<h2>Hello, %s!</h2>", r->useragent_ip); + ap_rprintf(r, "<h2>Hello, %s!</h2>", r->useragent_ip); /* If we were reached through a GET or a POST request, be happy, else sad. */ - if ( !strcmp(r->method, "POST") || !strcmp(r->method, "GET") ) { - ap_rputs("You used a GET or a POST method, that makes us happy!<br/>", r); + if ( !strcmp(r->method, "POST") || !strcmp(r->method, "GET") ) { + ap_rputs("You used a GET or a POST method, that makes us happy!<br/>", r); } else { - ap_rputs("You did not use POST or GET, that makes us sad :(<br/>", r); + ap_rputs("You did not use POST or GET, that makes us sad :(<br/>", r); } /* Lastly, if there was a query string, let's print that too! */ if (r->args) { - ap_rprintf(r, "Your query string was: %s", r->args); + ap_rprintf(r, "Your query string was: %s", r->args); } return OK; } @@ -611,8 +611,8 @@ static int example_handler(request_rec *r) const char *digestType; - /* Check that the "example-handler" handler is being called. */ - if (!r->handler || strcmp(r->handler, "example-handler")) return (DECLINED); + /* Check that the "example-handler" handler is being called. */ + if (!r->handler || strcmp(r->handler, "example-handler")) return (DECLINED); /* Figure out which file is being requested by removing the .sum from it */ filename = apr_pstrdup(r->pool, r->filename); @@ -637,22 +637,22 @@ static int example_handler(request_rec *r) ap_parse_form_data(r, NULL, &POST, -1, 8192); /* Set the appropriate content type */ - ap_set_content_type(r, "text/html"); + ap_set_content_type(r, "text/html"); /* Print a title and some general information */ - ap_rprintf(r, "<h2>Information on %s:</h2>", filename); - ap_rprintf(r, "<b>Size:</b> %u bytes<br/>", finfo.size); + ap_rprintf(r, "<h2>Information on %s:</h2>", filename); + ap_rprintf(r, "<b>Size:</b> %u bytes<br/>", finfo.size); /* Get the digest type the client wants to see */ - digestType = apr_table_get(GET, "digest"); - if (!digestType) digestType = "MD5"; + digestType = apr_table_get(GET, "digest"); + if (!digestType) digestType = "MD5"; rc = apr_file_open(&file, filename, APR_READ, APR_OS_DEFAULT, r->pool); if (rc == APR_SUCCESS) { /* Are we trying to calculate the MD5 or the SHA1 digest? */ - if (!strcasecmp(digestType, "md5")) { + if (!strcasecmp(digestType, "md5")) { /* Calculate the MD5 sum of the file */ union { char chr[16]; @@ -667,13 +667,13 @@ static int example_handler(request_rec *r) apr_md5_final(digest.chr, &md5); /* Print out the MD5 digest */ - ap_rputs("<b>MD5: </b><code>", r); + ap_rputs("<b>MD5: </b><code>", r); for (n = 0; n < APR_MD5_DIGESTSIZE/4; n++) { - ap_rprintf(r, "%08x", digest.num[n]); + ap_rprintf(r, "%08x", digest.num[n]); } - ap_rputs("</code>", r); + ap_rputs("</code>", r); /* Print a link to the SHA1 version */ - ap_rputs("<br/><a href='?digest=sha1'>View the SHA1 hash instead</a>", r); + ap_rputs("<br/><a href='?digest=sha1'>View the SHA1 hash instead</a>", r); } else { /* Calculate the SHA1 sum of the file */ @@ -690,14 +690,14 @@ static int example_handler(request_rec *r) apr_sha1_final(digest.chr, &sha1); /* Print out the SHA1 digest */ - ap_rputs("<b>SHA1: </b><code>", r); + ap_rputs("<b>SHA1: </b><code>", r); for (n = 0; n < APR_SHA1_DIGESTSIZE/4; n++) { - ap_rprintf(r, "%08x", digest.num[n]); + ap_rprintf(r, "%08x", digest.num[n]); } - ap_rputs("</code>", r); + ap_rputs("</code>", r); /* Print a link to the MD5 version */ - ap_rputs("<br/><a href='?digest=md5'>View the MD5 hash instead</a>", r); + ap_rputs("<br/><a href='?digest=md5'>View the MD5 hash instead</a>", r); } apr_file_close(file); @@ -735,8 +735,8 @@ these directives control how mod_rewrite works:

RewriteEngine On -RewriteCond %{REQUEST_URI} ^/foo/bar -RewriteRule ^/foo/bar/(.*)$ /foobar?page=$1 +RewriteCond "%{REQUEST_URI}" "^/foo/bar" +RewriteRule "^/foo/bar/(.*)$" "/foobar?page=$1"

Each of these configuration directives are handled by a separate function, @@ -776,18 +776,18 @@ static example_config config; static int example_handler(request_rec *r) { - if (!r->handler || strcmp(r->handler, "example-handler")) return(DECLINED); - ap_set_content_type(r, "text/plain"); - ap_rprintf(r, "Enabled: %u\n", config.enabled); - ap_rprintf(r, "Path: %s\n", config.path); - ap_rprintf(r, "TypeOfAction: %x\n", config.typeOfAction); + if (!r->handler || strcmp(r->handler, "example-handler")) return(DECLINED); + ap_set_content_type(r, "text/plain"); + ap_rprintf(r, "Enabled: %u\n", config.enabled); + ap_rprintf(r, "Path: %s\n", config.path); + ap_rprintf(r, "TypeOfAction: %x\n", config.typeOfAction); return OK; } static void register_hooks(apr_pool_t *pool) { config.enabled = 1; - config.path = "/foo/bar"; + config.path = "/foo/bar"; config.typeOfAction = 0x00; ap_hook_handler(example_handler, NULL, NULL, APR_HOOK_LAST); } @@ -812,7 +812,7 @@ So far so good. To access our new handler, we could add the following to our configuration:

-<Location /example> +<Location "/example"> SetHandler example-handler </Location> @@ -972,30 +972,30 @@ static example_config config; Our directive handlers: ============================================================================== */ -/* Handler for the "exampleEnabled" directive */ +/* Handler for the "exampleEnabled" directive */ const char *example_set_enabled(cmd_parms *cmd, void *cfg, const char *arg) { - if(!strcasecmp(arg, "on")) config.enabled = 1; + if(!strcasecmp(arg, "on")) config.enabled = 1; else config.enabled = 0; return NULL; } -/* Handler for the "examplePath" directive */ +/* Handler for the "examplePath" directive */ const char *example_set_path(cmd_parms *cmd, void *cfg, const char *arg) { config.path = arg; return NULL; } -/* Handler for the "exampleAction" directive */ +/* Handler for the "exampleAction" directive */ /* Let's pretend this one takes one argument (file or db), and a second (deny or allow), */ /* and we store it in a bit-wise manner. */ const char *example_set_action(cmd_parms *cmd, void *cfg, const char *arg1, const char *arg2) { - if(!strcasecmp(arg1, "file")) config.typeOfAction = 0x01; + if(!strcasecmp(arg1, "file")) config.typeOfAction = 0x01; else config.typeOfAction = 0x02; - if(!strcasecmp(arg2, "deny")) config.typeOfAction += 0x10; + if(!strcasecmp(arg2, "deny")) config.typeOfAction += 0x10; else config.typeOfAction += 0x20; return NULL; } @@ -1007,9 +1007,9 @@ const char *example_set_action(cmd_parms *cmd, void *cfg, const char *arg1, cons */ static const command_rec example_directives[] = { - AP_INIT_TAKE1("exampleEnabled", example_set_enabled, NULL, RSRC_CONF, "Enable or disable mod_example"), - AP_INIT_TAKE1("examplePath", example_set_path, NULL, RSRC_CONF, "The path to whatever"), - AP_INIT_TAKE2("exampleAction", example_set_action, NULL, RSRC_CONF, "Special action value!"), + AP_INIT_TAKE1("exampleEnabled", example_set_enabled, NULL, RSRC_CONF, "Enable or disable mod_example"), + AP_INIT_TAKE1("examplePath", example_set_path, NULL, RSRC_CONF, "The path to whatever"), + AP_INIT_TAKE2("exampleAction", example_set_action, NULL, RSRC_CONF, "Special action value!"), { NULL } }; /* @@ -1019,11 +1019,11 @@ static const command_rec example_directives[] = */ static int example_handler(request_rec *r) { - if(!r->handler || strcmp(r->handler, "example-handler")) return(DECLINED); - ap_set_content_type(r, "text/plain"); - ap_rprintf(r, "Enabled: %u\n", config.enabled); - ap_rprintf(r, "Path: %s\n", config.path); - ap_rprintf(r, "TypeOfAction: %x\n", config.typeOfAction); + if(!r->handler || strcmp(r->handler, "example-handler")) return(DECLINED); + ap_set_content_type(r, "text/plain"); + ap_rprintf(r, "Enabled: %u\n", config.enabled); + ap_rprintf(r, "Path: %s\n", config.path); + ap_rprintf(r, "TypeOfAction: %x\n", config.typeOfAction); return OK; } @@ -1035,7 +1035,7 @@ static int example_handler(request_rec *r) static void register_hooks(apr_pool_t *pool) { config.enabled = 1; - config.path = "/foo/bar"; + config.path = "/foo/bar"; config.typeOfAction = 3; ap_hook_handler(example_handler, NULL, NULL, APR_HOOK_LAST); } @@ -1086,12 +1086,12 @@ within which modules must operate. For example, let's assume you have this configuration set up for mod_rewrite:

-<Directory "/var/www"> - RewriteCond %{HTTP_HOST} ^example.com$ - RewriteRule (.*) http://www.example.com/$1 +<Directory "/var/www"> + RewriteCond "%{HTTP_HOST}" "^example.com$" + RewriteRule "(.*)" "http://www.example.com/$1" </Directory> -<Directory "/var/www/sub"> - RewriteRule ^foobar$ index.php?foobar=true +<Directory "/var/www/sub"> + RewriteRule "^foobar$" "index.php?foobar=true" </Directory>

@@ -1259,12 +1259,12 @@ configurations. This part of the process particularly applies to scenarios where you have a parent configuration and a child, such as the following:

-<Directory "/var/www"> +<Directory "/var/www"> ExampleEnabled On - ExamplePath /foo/bar + ExamplePath "/foo/bar" ExampleAction file allow </Directory> -<Directory "/var/www/subdir"> +<Directory "/var/www/subdir"> ExampleAction file deny </Directory> @@ -1315,21 +1315,21 @@ context aware. First off, we'll create a configuration that lets us test how the module works:

-<Location "/a"> +<Location "/a"> SetHandler example-handler ExampleEnabled on - ExamplePath "/foo/bar" + ExamplePath "/foo/bar" ExampleAction file allow </Location> -<Location "/a/b"> +<Location "/a/b"> ExampleAction file deny ExampleEnabled off </Location> -<Location "/a/b/c"> +<Location "/a/b/c"> ExampleAction db deny - ExamplePath "/foo/bar/baz" + ExamplePath "/foo/bar/baz" ExampleEnabled on </Location> @@ -1395,9 +1395,9 @@ static void register_hooks(apr_pool_t *pool); static const command_rec directives[] = { - AP_INIT_TAKE1("exampleEnabled", example_set_enabled, NULL, ACCESS_CONF, "Enable or disable mod_example"), - AP_INIT_TAKE1("examplePath", example_set_path, NULL, ACCESS_CONF, "The path to whatever"), - AP_INIT_TAKE2("exampleAction", example_set_action, NULL, ACCESS_CONF, "Special action value!"), + AP_INIT_TAKE1("exampleEnabled", example_set_enabled, NULL, ACCESS_CONF, "Enable or disable mod_example"), + AP_INIT_TAKE1("examplePath", example_set_path, NULL, ACCESS_CONF, "The path to whatever"), + AP_INIT_TAKE2("exampleAction", example_set_action, NULL, ACCESS_CONF, "Special action value!"), { NULL } }; @@ -1435,23 +1435,23 @@ static void register_hooks(apr_pool_t *pool) */ static int example_handler(request_rec *r) { - if(!r->handler || strcmp(r->handler, "example-handler")) return(DECLINED); + if(!r->handler || strcmp(r->handler, "example-handler")) return(DECLINED); /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ example_config *config = (example_config *) ap_get_module_config(r->per_dir_config, &example_module); /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - ap_set_content_type(r, "text/plain"); - ap_rprintf(r, "Enabled: %u\n", config->enabled); - ap_rprintf(r, "Path: %s\n", config->path); - ap_rprintf(r, "TypeOfAction: %x\n", config->typeOfAction); - ap_rprintf(r, "Context: %s\n", config->context); + ap_set_content_type(r, "text/plain"); + ap_rprintf(r, "Enabled: %u\n", config->enabled); + ap_rprintf(r, "Path: %s\n", config->path); + ap_rprintf(r, "TypeOfAction: %x\n", config->typeOfAction); + ap_rprintf(r, "Context: %s\n", config->context); return OK; } /* ======================================================================================================================= - Handler for the "exampleEnabled" directive + Handler for the "exampleEnabled" directive ======================================================================================================================= */ const char *example_set_enabled(cmd_parms *cmd, void *cfg, const char *arg) @@ -1462,7 +1462,7 @@ const char *example_set_enabled(cmd_parms *cmd, void *cfg, const char *arg) if(conf) { - if(!strcasecmp(arg, "on")) + if(!strcasecmp(arg, "on")) conf->enabled = 1; else conf->enabled = 0; @@ -1473,7 +1473,7 @@ const char *example_set_enabled(cmd_parms *cmd, void *cfg, const char *arg) /* ======================================================================================================================= - Handler for the "examplePath" directive + Handler for the "examplePath" directive ======================================================================================================================= */ const char *example_set_path(cmd_parms *cmd, void *cfg, const char *arg) @@ -1492,7 +1492,7 @@ const char *example_set_path(cmd_parms *cmd, void *cfg, const char *arg) /* ======================================================================================================================= - Handler for the "exampleAction" directive ; + Handler for the "exampleAction" directive ; Let's pretend this one takes one argument (file or db), and a second (deny or allow), ; and we store it in a bit-wise manner. ======================================================================================================================= @@ -1506,11 +1506,11 @@ const char *example_set_action(cmd_parms *cmd, void *cfg, const char *arg1, cons if(conf) { { - if(!strcasecmp(arg1, "file")) + if(!strcasecmp(arg1, "file")) conf->typeOfAction = 0x01; else conf->typeOfAction = 0x02; - if(!strcasecmp(arg2, "deny")) + if(!strcasecmp(arg2, "deny")) conf->typeOfAction += 0x10; else conf->typeOfAction += 0x20; @@ -1527,7 +1527,7 @@ const char *example_set_action(cmd_parms *cmd, void *cfg, const char *arg1, cons */ void *create_dir_conf(apr_pool_t *pool, char *context) { - context = context ? context : "Newly created configuration"; + context = context ? context : "Newly created configuration"; /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ example_config *cfg = apr_pcalloc(pool, sizeof(example_config)); @@ -1557,7 +1557,7 @@ void *merge_dir_conf(apr_pool_t *pool, void *BASE, void *ADD) /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ example_config *base = (example_config *) BASE; example_config *add = (example_config *) ADD; - example_config *conf = (example_config *) create_dir_conf(pool, "Merged configuration"); + example_config *conf = (example_config *) create_dir_conf(pool, "Merged configuration"); /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ conf->enabled = (add->enabled == 0) ? base->enabled : add->enabled; @@ -1634,11 +1634,11 @@ static int example_handler(request_rec *r) int i; for (i = 0; &formData[i]; i++) { if (formData[i].key && formData[i].value) { - ap_rprintf(r, "%s = %s\n", formData[i].key, formData[i].value); + ap_rprintf(r, "%s = %s\n", formData[i].key, formData[i].value); } else if (formData[i].key) { - ap_rprintf(r, "%s\n", formData[i].key); + ap_rprintf(r, "%s\n", formData[i].key); } else if (formData[i].value) { - ap_rprintf(r, "= %s\n", formData[i].value); + ap_rprintf(r, "= %s\n", formData[i].value); } else { break; } @@ -1668,7 +1668,7 @@ static int example_handler(request_rec *r) fields = apr_table_elts(r->headers_in); e = (apr_table_entry_t *) fields->elts; for(i = 0; i < fields->nelts; i++) { - ap_rprintf(r, "%s: %s\n", e[i].key, e[i].val); + ap_rprintf(r, "%s: %s\n", e[i].key, e[i].val); } return OK; } @@ -1726,7 +1726,7 @@ static int example_handler(request_rec *r) /*~~~~~~~~~~~~~~~~*/ if(util_read(r, &buffer, &size) == OK) { - ap_rprintf(r, "We read a request body that was %" APR_OFF_T_FMT " bytes long", size); + ap_rprintf(r, "We read a request body that was %" APR_OFF_T_FMT " bytes long", size); } return OK; } diff --git a/docs/manual/dns-caveats.xml b/docs/manual/dns-caveats.xml index 2ff924b102..624fd86cb4 100644 --- a/docs/manual/dns-caveats.xml +++ b/docs/manual/dns-caveats.xml @@ -41,7 +41,7 @@ # This is a misconfiguration example, do not use on your server <VirtualHost www.example.dom> ServerAdmin webgirl@example.dom - DocumentRoot /www/example + DocumentRoot "/www/example" </VirtualHost> @@ -63,7 +63,7 @@ # This is a misconfiguration example, do not use on your server <VirtualHost 192.0.2.1> ServerAdmin webgirl@example.dom - DocumentRoot /www/example + DocumentRoot "/www/example" </VirtualHost> @@ -82,7 +82,7 @@ <VirtualHost 192.0.2.1> ServerName www.example.dom ServerAdmin webgirl@example.dom - DocumentRoot /www/example + DocumentRoot "/www/example" </VirtualHost> @@ -95,11 +95,11 @@ <VirtualHost www.example1.dom> ServerAdmin webgirl@example1.dom - DocumentRoot /www/example1 + DocumentRoot "/www/example1" </VirtualHost> <VirtualHost www.example2.dom> ServerAdmin webguy@example2.dom - DocumentRoot /www/example2 + DocumentRoot "/www/example2" </VirtualHost> diff --git a/docs/manual/env.xml b/docs/manual/env.xml index 5bfefb285f..d4375cf688 100644 --- a/docs/manual/env.xml +++ b/docs/manual/env.xml @@ -526,7 +526,7 @@ CustomLog logs/access_log common env=!image-request SetEnvIf Referer "^http://www\.example\.com/" local_referal # Allow browsers that do not send Referer info SetEnvIf Referer "^$" local_referal -<Directory /web/images> +<Directory "/web/images"> Require env local_referal </Directory> diff --git a/docs/manual/expr.xml b/docs/manual/expr.xml index eed2f0ac49..e49313c5fd 100644 --- a/docs/manual/expr.xml +++ b/docs/manual/expr.xml @@ -542,7 +542,7 @@ listfunction ::= listfuncname "(" word ")" # Compare the host name to example.com and redirect to www.example.com if it matches <If "%{HTTP_HOST} == 'example.com'"> - Redirect permanent / http://www.example.com/ + Redirect permanent "/" "http://www.example.com/" </If> # Force text/plain if requesting a file with the query string contains 'forcetext' @@ -566,7 +566,7 @@ listfunction ::= listfuncname "(" word ")" </If> # Check result of URI mapping by running in Directory context with -f -<Directory /var/www> +<Directory "/var/www"> AddEncoding x-gzip gz <If "-f '%{REQUEST_FILENAME}.unzipme' && ! %{HTTP:Accept-Encoding} =~ /gzip/"> SetOutputFilter INFLATE diff --git a/docs/manual/handler.xml b/docs/manual/handler.xml index 98dc9599bf..fd37d5603e 100644 --- a/docs/manual/handler.xml +++ b/docs/manual/handler.xml @@ -127,7 +127,7 @@ AddHandler add-footer .html filename extensions.

-<Directory /web/htdocs/asis> +<Directory "/web/htdocs/asis"> SetHandler send-as-is </Directory> diff --git a/docs/manual/howto/access.xml b/docs/manual/howto/access.xml index 3353c91a2b..0769292d97 100644 --- a/docs/manual/howto/access.xml +++ b/docs/manual/howto/access.xml @@ -170,9 +170,9 @@ Require expr %{HTTP_USER_AGENT} != 'BadBot' RewriteEngine On -RewriteCond %{TIME_HOUR} >=20 [OR] -RewriteCond %{TIME_HOUR} <07 -RewriteRule ^/fridge - [F] +RewriteCond "%{TIME_HOUR}" ">=20" [OR] +RewriteCond "%{TIME_HOUR}" "<07" +RewriteRule "^/fridge" "-" [F]

This will return a 403 Forbidden response for any request after 8pm diff --git a/docs/manual/howto/auth.xml b/docs/manual/howto/auth.xml index d6d80f4af4..388e69eee6 100644 --- a/docs/manual/howto/auth.xml +++ b/docs/manual/howto/auth.xml @@ -197,14 +197,14 @@ module from each group.

following directives, either placed in the file /usr/local/apache/htdocs/secret/.htaccess, or placed in httpd.conf inside a <Directory - /usr/local/apache/htdocs/secret> section.

+ "/usr/local/apache/htdocs/secret"> section.

AuthType Basic AuthName "Restricted Files" # (Following line optional) AuthBasicProvider file -AuthUserFile /usr/local/apache/passwd/passwords +AuthUserFile "/usr/local/apache/passwd/passwords" Require user rbowen @@ -310,8 +310,8 @@ AuthType Basic AuthName "By Invitation Only" # Optional line: AuthBasicProvider file -AuthUserFile /usr/local/apache/passwd/passwords -AuthGroupFile /usr/local/apache/passwd/groups +AuthUserFile "/usr/local/apache/passwd/passwords" +AuthGroupFile "/usr/local/apache/passwd/groups" Require group GroupName
@@ -365,11 +365,11 @@ Require group GroupName

To select a dbm file rather than a text file, for example:

-<Directory /www/docs/private> +<Directory "/www/docs/private"> AuthName "Private" AuthType Basic AuthBasicProvider dbm - AuthDBMUserFile /www/passwords/passwd.dbm + AuthDBMUserFile "/www/passwords/passwd.dbm" Require valid-user </Directory> @@ -388,11 +388,11 @@ Require group GroupName file and LDAP based authentication providers are being used.

-<Directory /www/docs/private> +<Directory "/www/docs/private"> AuthName "Private" AuthType Basic AuthBasicProvider file ldap - AuthUserFile /usr/local/apache/passwd/passwords + AuthUserFile "/usr/local/apache/passwd/passwords" AuthLDAPURL ldap://ldaphost/o=yourorg Require valid-user </Directory> @@ -412,13 +412,13 @@ Require group GroupName authorization as well as LDAP group authorization is being used.

-<Directory /www/docs/private> +<Directory "/www/docs/private"> AuthName "Private" AuthType Basic AuthBasicProvider file - AuthUserFile /usr/local/apache/passwd/passwords + AuthUserFile "/usr/local/apache/passwd/passwords" AuthLDAPURL ldap://ldaphost/o=yourorg - AuthGroupFile /usr/local/apache/passwd/groups + AuthGroupFile "/usr/local/apache/passwd/groups" Require group GroupName Require ldap-group cn=mygroup,o=yourorg </Directory> diff --git a/docs/manual/howto/cgi.xml b/docs/manual/howto/cgi.xml index bf6f4dc6c8..c1f97e4ded 100644 --- a/docs/manual/howto/cgi.xml +++ b/docs/manual/howto/cgi.xml @@ -84,7 +84,7 @@ directive looks like:

- ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/ + ScriptAlias "/cgi-bin/" "/usr/local/apache2/cgi-bin/"

The example shown is from your default httpd.conf @@ -146,7 +146,7 @@ directory:

-<Directory /usr/local/apache2/htdocs/somedir> +<Directory "/usr/local/apache2/htdocs/somedir"> Options +ExecCGI </Directory> @@ -179,7 +179,7 @@ following configuration.

-<Directory /home/*/public_html> +<Directory "/home/*/public_html"> Options +ExecCGI AddHandler cgi-script .cgi </Directory> @@ -190,7 +190,7 @@ program, you can use the following.

-<Directory /home/*/public_html/cgi-bin> +<Directory "/home/*/public_html/cgi-bin"> Options ExecCGI SetHandler cgi-script </Directory> diff --git a/docs/manual/howto/htaccess.xml b/docs/manual/howto/htaccess.xml index 6902decd55..988fe25b4a 100644 --- a/docs/manual/howto/htaccess.xml +++ b/docs/manual/howto/htaccess.xml @@ -77,7 +77,9 @@ changes on a per-directory basis.

if you would rather call the file .config then you can put the following in your server configuration file:

- AccessFileName .config + +AccessFileName ".config" +

In general, .htaccess files use the same syntax as @@ -209,21 +211,23 @@ changes on a per-directory basis.

Note that it is completely equivalent to put a .htaccess file in a directory /www/htdocs/example containing a directive, and to put that same directive in a Directory section - <Directory /www/htdocs/example> in your main server + <Directory "/www/htdocs/example"> in your main server configuration:

.htaccess file in /www/htdocs/example:

Contents of .htaccess file in <code>/www/htdocs/example</code> - AddType text/example .exm + +AddType text/example ".exm" + Section from your <code>httpd.conf</code> file -<Directory /www/htdocs/example> - AddType text/example .exm +<Directory "/www/htdocs/example"> + AddType text/example ".exm" </Directory> @@ -237,7 +241,9 @@ changes on a per-directory basis.

by setting the AllowOverride directive to none:

- AllowOverride None + +AllowOverride None +
How directives are applied @@ -258,7 +264,9 @@ changes on a per-directory basis.

In the directory /www/htdocs/example1 we have a .htaccess file containing the following:

- Options +ExecCGI + +Options +ExecCGI +

(Note: you must have "AllowOverride Options" in effect to permit the use of the "

In the directory /www/htdocs/example1/example2 we have a .htaccess file containing:

- Options Includes + +Options Includes +

Because of this second .htaccess file, in the directory /www/htdocs/example1/example2, CGI execution is not @@ -292,11 +302,11 @@ changes on a per-directory basis.

.htaccess you can use:

-<Directory /www/htdocs> +<Directory "/www/htdocs"> AllowOverride All </Directory> -<Location /> +<Location "/"> Options +IncludesNoExec -ExecCGI
</Location>
@@ -330,8 +340,8 @@ changes on a per-directory basis.

AuthType Basic AuthName "Password Required" -AuthUserFile /www/passwords/password.file -AuthGroupFile /www/passwords/group.file +AuthUserFile "/www/passwords/password.file" +AuthGroupFile "/www/passwords/group.file" Require group admins @@ -372,13 +382,13 @@ Consider the following examples:

# In httpd.conf -RewriteRule ^/images/(.+)\.jpg /images/$1.png +RewriteRule "^/images/(.+)\.jpg" "/images/$1.png" # In .htaccess in root dir -RewriteRule ^images/(.+)\.jpg images/$1.png +RewriteRule "^images/(.+)\.jpg" "images/$1.png" # In .htaccess in images/ -RewriteRule ^(.+)\.jpg $1.png +RewriteRule "^(.+)\.jpg" "$1.png"

In a .htaccess in your document directory, the leading diff --git a/docs/manual/howto/public_html.xml b/docs/manual/howto/public_html.xml index fbcef0fb7f..063501378b 100644 --- a/docs/manual/howto/public_html.xml +++ b/docs/manual/howto/public_html.xml @@ -154,7 +154,7 @@ cgi-enabled.

-<Directory /home/*/public_html/cgi-bin/> +<Directory "/home/*/public_html/cgi-bin/"> Options ExecCGI SetHandler cgi-script </Directory> diff --git a/docs/manual/misc/perf-tuning.xml b/docs/manual/misc/perf-tuning.xml index bb44c33a82..5429f0b872 100644 --- a/docs/manual/misc/perf-tuning.xml +++ b/docs/manual/misc/perf-tuning.xml @@ -147,7 +147,7 @@ using these directives, if possible.

Note that it's possible to scope the directives, such as - within a <Location /server-status> section. + within a <Location "/server-status"> section. In this case the DNS lookups are only performed on requests matching the criteria. Here's an example which disables lookups except for .html and .cgi files:

@@ -176,8 +176,8 @@ HostnameLookups off filename component. For example, if you had:

-DocumentRoot /www/htdocs -<Directory /> +DocumentRoot "/www/htdocs" +<Directory "/"> Options SymLinksIfOwnerMatch </Directory> @@ -191,12 +191,12 @@ DocumentRoot /www/htdocs security checking you can do something like this:

-DocumentRoot /www/htdocs -<Directory /> +DocumentRoot "/www/htdocs" +<Directory "/"> Options FollowSymLinks </Directory> -<Directory /www/htdocs> +<Directory "/www/htdocs"> Options -FollowSymLinks +SymLinksIfOwnerMatch </Directory> @@ -222,8 +222,8 @@ DocumentRoot /www/htdocs example,

-DocumentRoot /www/htdocs -<Directory /> +DocumentRoot "/www/htdocs" +<Directory "/"> AllowOverride all </Directory> diff --git a/docs/manual/misc/security_tips.xml b/docs/manual/misc/security_tips.xml index 5664ff9d3e..af003eb889 100644 --- a/docs/manual/misc/security_tips.xml +++ b/docs/manual/misc/security_tips.xml @@ -328,7 +328,7 @@

In the server configuration file, put

-<Directory /> +<Directory "/"> AllowOverride None </Directory> @@ -361,7 +361,7 @@ configuration:

-<Directory /> +<Directory "/"> Require all denied </Directory> @@ -371,10 +371,10 @@ allow access only in those areas you wish. For example,

-<Directory /usr/users/*/public_html> +<Directory "/usr/users/*/public_html"> Require all granted </Directory> -<Directory /usr/local/httpd> +<Directory "/usr/local/httpd"> Require all granted </Directory> @@ -382,8 +382,8 @@

Pay particular attention to the interactions of Location and Directory directives; for instance, even - if <Directory /> denies access, a - <Location /> directive might overturn it.

+ if <Directory "/"> denies access, a + <Location "/"> directive might overturn it.

Also be wary of playing games with the UserDir directive; setting it to diff --git a/docs/manual/mod/core.html.en b/docs/manual/mod/core.html.en index 922614ffe7..84d8afbbf2 100644 --- a/docs/manual/mod/core.html.en +++ b/docs/manual/mod/core.html.en @@ -291,7 +291,7 @@ AcceptFilter https data /usr/local/.acl and /usr/local/web/.acl for directives, unless they have been disabled with

-
<Directory />
+    
<Directory "/">
     AllowOverride None
 </Directory>
@@ -527,7 +527,7 @@ NoDecode option available in 2.3.12 and later.

For security and performance reasons, do not set AllowOverride to anything other than None - in your <Directory /> block. Instead, find (or + in your <Directory "/"> block. Instead, find (or create) the <Directory> block that refers to the directory where you're actually planning to place a .htaccess file.

@@ -771,7 +771,7 @@ DocumentRoot /var/www/${servername}/htdocs
- @@ -788,9 +788,9 @@ named file-system directory, sub-directories, and their contents. any single character, and * matches any sequences of characters. You may also use [] character ranges. None of the wildcards match a `/' character, so <Directory - /*/public_html> will not match + "/*/public_html"> will not match /home/user/public_html, but <Directory - /home/*/public_html> will match. Example:

+ "/home/*/public_html"> will match. Example:

<Directory "/usr/local/httpd/htdocs">
   Options Indexes FollowSymLinks
@@ -824,7 +824,7 @@ named file-system directory, sub-directories, and their contents.
     first, interspersed with the directives from the .htaccess files. For example,
     with

-
<Directory />
+    
<Directory "/">
   AllowOverride None
 </Directory>
 
@@ -866,12 +866,12 @@ named file-system directory, sub-directories, and their contents.
     be applied.

Note that the default access for - <Directory /> is to permit all access. + <Directory "/"> is to permit all access. This means that Apache httpd will serve any file mapped from an URL. It is recommended that you change this with a block such as

-
<Directory />
+    
<Directory "/">
   Require all denied
 </Directory>
@@ -897,7 +897,7 @@ named file-system directory, sub-directories, and their contents.
Description:Enclose a group of directives that apply only to the named file-system directory, sub-directories, and their contents.
Syntax:<Directory directory-path> +
Syntax:<Directory "directory-path"> ... </Directory>
Context:server config, virtual host
Status:Core
- @@ -939,7 +939,7 @@ the contents of file-system directories matching a regular expression.mod_rewrite. In order to prevent confusion, numbered (unnamed) backreferences are ignored. Use named groups instead.

-
<DirectoryMatch ^/var/www/combined/(?<sitename>[^/]+)>
+
<DirectoryMatch "^/var/www/combined/(?<sitename>[^/]+)">
     Require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example
 </DirectoryMatch>
@@ -1283,7 +1283,7 @@ ErrorDocument 403 /cgi-bin/forbidden.pl?referrer=%{escape:%{HTTP_REFERER}}
ErrorDocument 404 /cgi-bin/bad_urls.pl
 
-<Directory /web/docs>
+<Directory "/web/docs">
   ErrorDocument 404 default
 </Directory>
@@ -1671,7 +1671,7 @@ earlier.
Description:Enclose directives that apply to the contents of file-system directories matching a regular expression.
Syntax:<DirectoryMatch regex> +
Syntax:<DirectoryMatch "regex"> ... </DirectoryMatch>
Context:server config, virtual host
Status:Core
- + @@ -1732,7 +1732,7 @@ filenames
Description:Contains directives that apply to matched filenames
Syntax:<Files filename> ... </Files>
Syntax:<Files "filename"> ... </Files>
Context:server config, virtual host, directory, .htaccess
Override:All
Status:Core
- + @@ -1762,7 +1762,7 @@ filenamesmod_rewrite. In order to prevent confusion, numbered (unnamed) backreferences are ignored. Use named groups instead.

-
<FilesMatch ^(?<sitename>[^/]+)>
+
<FilesMatch "^(?<sitename>[^/]+)">
     require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example
 </FilesMatch>
@@ -1807,12 +1807,12 @@ media type in the HTTP Content-Type header field by using the value of None:

# force all files to be image/gif:
-<Location /images>
+<Location "/images">
   ForceType image/gif
 </Location>
 
 # but normal mime-type associations here:
-<Location /images/mixed>
+<Location "/images/mixed">
   ForceType None
 </Location>
@@ -2558,7 +2558,7 @@ from the client
+ "URL-path|URL"> ... </Location> @@ -2596,7 +2596,7 @@ URLs /private1, /private1/ and /private1/file.txt will have the enclosed directives applied, but /private1other would not.

-
<Location /private1>
+    
<Location "/private1">
     #  ...
 </Location>
@@ -2605,7 +2605,7 @@ URLs /private2/ and /private2/file.txt will have the enclosed directives applied, but /private2 and /private2other would not.

-
<Location /private2/>
+    
<Location "/private2/">
     # ...
 </Location>
@@ -2615,7 +2615,7 @@ URLs

Use <Location> to apply directives to content that lives outside the filesystem. For content that lives in the filesystem, use <Directory> and <Files>. An exception is - <Location />, which is an easy way to + <Location "/">, which is an easy way to apply a configuration to the entire server.

@@ -2651,7 +2651,7 @@ URLs directive. For example, to enable status requests, but allow them only from browsers at example.com, you might use:

-
<Location /status>
+    
<Location "/status">
   SetHandler server-status
   Require host example.com
 </Location>
@@ -2667,12 +2667,12 @@ URLs directive and the regex version of <Location> require you to explicitly specify multiple slashes if that is your intention.

-

For example, <LocationMatch ^/abc> would match +

For example, <LocationMatch "^/abc"> would match the request URL /abc but not the request URL //abc. The (non-regex) <Location> directive behaves similarly when used for proxy requests. But when (non-regex) <Location> is used for non-proxy requests it will implicitly match multiple slashes with a single slash. For example, - if you specify <Location /abc/def> and the + if you specify <Location "/abc/def"> and the request is to /abc//def then it will match.

@@ -2690,7 +2690,7 @@ URLs
+ "regex"> ... </LocationMatch> @@ -2725,7 +2725,7 @@ matching URLsmod_rewrite. In order to prevent confusion, numbered (unnamed) backreferences are ignored. Use named groups instead.

-
<LocationMatch ^/combined/(?<sitename>[^/]+)>
+
<LocationMatch "^/combined/(?<sitename>[^/]+)">
     require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example
 </LocationMatch>
@@ -4088,7 +4088,7 @@ handler

You could also use this directive to configure a particular handler for files with a particular file extension. For example:

-
<FilesMatch \.php$>
+    
<FilesMatch "\.php$">
     SetHandler application/x-httpd-php
 </FilesMatch>
diff --git a/docs/manual/mod/core.xml b/docs/manual/mod/core.xml index fc9076e325..448aee9a47 100644 --- a/docs/manual/mod/core.xml +++ b/docs/manual/mod/core.xml @@ -204,7 +204,7 @@ AcceptFilter https data for directives, unless they have been disabled with

-<Directory /> +<Directory "/"> AllowOverride None </Directory> @@ -468,7 +468,7 @@ NoDecode option available in 2.3.12 and later.

For security and performance reasons, do not set AllowOverride to anything other than None - in your <Directory /> block. Instead, find (or + in your <Directory "/"> block. Instead, find (or create) the <Directory> block that refers to the directory where you're actually planning to place a .htaccess file.

@@ -699,7 +699,7 @@ which no other media type configuration could be found. Define SSL </IfDefine> -DocumentRoot /var/www/${servername}/htdocs +DocumentRoot "/var/www/${servername}/htdocs"

Variable names may not contain colon ":" characters, to avoid clashes @@ -711,7 +711,7 @@ DocumentRoot /var/www/${servername}/htdocs Directory Enclose a group of directives that apply only to the named file-system directory, sub-directories, and their contents. -<Directory directory-path> +<Directory "directory-path"> ... </Directory> server configvirtual host @@ -728,9 +728,9 @@ named file-system directory, sub-directories, and their contents. any single character, and * matches any sequences of characters. You may also use [] character ranges. None of the wildcards match a `/' character, so <Directory - /*/public_html> will not match + "/*/public_html"> will not match /home/user/public_html, but <Directory - /home/*/public_html> will match. Example:

+ "/home/*/public_html"> will match. Example:

<Directory "/usr/local/httpd/htdocs"> @@ -769,7 +769,7 @@ named file-system directory, sub-directories, and their contents. with

-<Directory /> +<Directory "/"> AllowOverride None </Directory> @@ -812,13 +812,13 @@ named file-system directory, sub-directories, and their contents. be applied.

Note that the default access for - <Directory /> is to permit all access. + <Directory "/"> is to permit all access. This means that Apache httpd will serve any file mapped from an URL. It is recommended that you change this with a block such as

-<Directory /> +<Directory "/"> Require all denied </Directory> @@ -888,7 +888,7 @@ the contents of file-system directories matching a regular expression. -<DirectoryMatch ^/var/www/combined/(?<sitename>[^/]+)> +<DirectoryMatch "^/var/www/combined/(?<sitename>[^/]+)"> Require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example </DirectoryMatch> @@ -907,7 +907,7 @@ sections are combined when a request is received Directory that forms the main document tree visible from the web DocumentRoot directory-path -DocumentRoot /usr/local/apache/htdocs +DocumentRoot "/usr/local/apache/htdocs" server configvirtual host @@ -1236,7 +1236,7 @@ ErrorDocument 403 /cgi-bin/forbidden.pl?referrer=%{escape:%{HTTP_REFERER}} ErrorDocument 404 /cgi-bin/bad_urls.pl -<Directory /web/docs> +<Directory "/web/docs"> ErrorDocument 404 default </Directory> @@ -1656,7 +1656,7 @@ earlier. Files Contains directives that apply to matched filenames -<Files filename> ... </Files> +<Files "filename"> ... </Files> server configvirtual host directory.htaccess @@ -1757,7 +1757,7 @@ filenames (unnamed) backreferences are ignored. Use named groups instead.

-<FilesMatch ^(?<sitename>[^/]+)> +<FilesMatch "^(?<sitename>[^/]+)"> require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example </FilesMatch> @@ -1800,12 +1800,12 @@ media type in the HTTP Content-Type header field # force all files to be image/gif: -<Location /images> +<Location "/images"> ForceType image/gif </Location> # but normal mime-type associations here: -<Location /images/mixed> +<Location "/images/mixed"> ForceType None </Location> @@ -2558,7 +2558,7 @@ from the client Applies the enclosed directives only to matching URLs <Location - URL-path|URL> ... </Location> + "URL-path|URL"> ... </Location> server configvirtual host @@ -2600,7 +2600,7 @@ URLs directives applied, but /private1other would not.

-<Location /private1> +<Location "/private1"> # ... </Location> @@ -2610,7 +2610,7 @@ URLs directives applied, but /private2 and /private2other would not.

-<Location /private2/> +<Location "/private2/"> # ... </Location> @@ -2623,7 +2623,7 @@ URLs content that lives in the filesystem, use Directory and Files. An exception is - <Location />, which is an easy way to + <Location "/">, which is an easy way to apply a configuration to the entire server.

@@ -2663,7 +2663,7 @@ URLs only from browsers at example.com, you might use:

-<Location /status> +<Location "/status"> SetHandler server-status Require host example.com </Location> @@ -2680,14 +2680,14 @@ URLs >Location require you to explicitly specify multiple slashes if that is your intention.

-

For example, <LocationMatch ^/abc> would match +

For example, <LocationMatch "^/abc"> would match the request URL /abc but not the request URL //abc. The (non-regex) Location directive behaves similarly when used for proxy requests. But when (non-regex) Location is used for non-proxy requests it will implicitly match multiple slashes with a single slash. For example, - if you specify <Location /abc/def> and the + if you specify <Location "/abc/def"> and the request is to /abc//def then it will match.

@@ -2740,7 +2740,7 @@ matching URLs (unnamed) backreferences are ignored. Use named groups instead.

-<LocationMatch ^/combined/(?<sitename>[^/]+)> +<LocationMatch "^/combined/(?<sitename>[^/]+)"> require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example </LocationMatch> @@ -4074,7 +4074,7 @@ handler handler for files with a particular file extension. For example:

-<FilesMatch \.php$> +<FilesMatch "\.php$"> SetHandler application/x-httpd-php </FilesMatch> @@ -4386,10 +4386,10 @@ hostname or IP address <VirtualHost 10.1.2.3:80> ServerAdmin webmaster@host.example.com - DocumentRoot /www/docs/host.example.com + DocumentRoot "/www/docs/host.example.com" ServerName host.example.com - ErrorLog logs/host.example.com-error_log - TransferLog logs/host.example.com-access_log + ErrorLog "logs/host.example.com-error_log" + TransferLog "logs/host.example.com-access_log" </VirtualHost> @@ -4401,10 +4401,10 @@ hostname or IP address <VirtualHost [2001:db8::a00:20ff:fea7:ccea]:80> ServerAdmin webmaster@host.example.com - DocumentRoot /www/docs/host.example.com + DocumentRoot "/www/docs/host.example.com" ServerName host.example.com - ErrorLog logs/host.example.com-error_log - TransferLog logs/host.example.com-access_log + ErrorLog "logs/host.example.com-error_log" + TransferLog "logs/host.example.com-access_log" </VirtualHost> diff --git a/docs/manual/mod/mod_access_compat.xml b/docs/manual/mod/mod_access_compat.xml index cf974c73ef..5d5f4cee77 100644 --- a/docs/manual/mod/mod_access_compat.xml +++ b/docs/manual/mod/mod_access_compat.xml @@ -198,7 +198,7 @@ Allow from 2001:db8::a00:20ff:fea7:ccea/10 SetEnvIf User-Agent ^KnockKnock/2\.0 let_me_in -<Directory /docroot> +<Directory "/docroot"> Order Deny,Allow Deny from all Allow from env=let_me_in @@ -376,7 +376,7 @@ Deny from foo.example.org example,

-<Directory /www> +<Directory "/www"> Order Allow,Deny </Directory> @@ -456,11 +456,11 @@ Satisfy Any

-<Directory /var/www/private> +<Directory "/var/www/private"> Require valid-user </Directory> -<Directory /var/www/private/public> +<Directory "/var/www/private/public"> Allow from all Satisfy Any </Directory> diff --git a/docs/manual/mod/mod_actions.xml b/docs/manual/mod/mod_actions.xml index 9b295b58ff..2ce49533ea 100644 --- a/docs/manual/mod/mod_actions.xml +++ b/docs/manual/mod/mod_actions.xml @@ -88,7 +88,7 @@ Action image/gif /cgi-bin/images.cgi # Files of a particular file extension AddHandler my-file-type .xyz -Action my-file-type /cgi-bin/program.cgi +Action my-file-type "/cgi-bin/program.cgi"

In this example, requests for files with a file extension of @@ -101,9 +101,9 @@ Action my-file-type /cgi-bin/program.cgi virtual locations.

-<Location /news> +<Location "/news"> SetHandler news-handler - Action news-handler /cgi-bin/news.cgi virtual + Action news-handler "/cgi-bin/news.cgi" virtual </Location> @@ -147,10 +147,10 @@ method. # All GET requests go here -Script GET /cgi-bin/search +Script GET "/cgi-bin/search" # A CGI PUT handler -Script PUT /~bob/put.cgi +Script PUT "/~bob/put.cgi" diff --git a/docs/manual/mod/mod_alias.xml b/docs/manual/mod/mod_alias.xml index b4e2711c04..015c7de3e6 100644 --- a/docs/manual/mod/mod_alias.xml +++ b/docs/manual/mod/mod_alias.xml @@ -48,7 +48,7 @@ a new location.

When the Alias, - ScriptAlias and + ScriptAlias and Redirect directives are used within a Location or LocationMatch @@ -89,8 +89,8 @@ href="../urlmapping.html">Mapping URLs to the filesystem configuration will work as expected:

-Alias /foo/bar /baz -Alias /foo /gaq +Alias "/foo/bar" "/baz" +Alias "/foo" "/gaq"

But if the above two directives were reversed in order, the @@ -100,13 +100,13 @@ Alias /foo /gaq ignored.

When the Alias, - ScriptAlias and + ScriptAlias and Redirect directives are used within a Location or LocationMatch section, these directives will take precedence over any globally defined Alias, - ScriptAlias and + ScriptAlias and Redirect directives.

@@ -131,7 +131,7 @@ Alias /foo /gaq file systems.

- Alias /image /ftp/pub/image + Alias "/image" "/ftp/pub/image"

A request for http://example.com/image/foo.gif would cause @@ -146,10 +146,10 @@ Alias /foo /gaq order to expand the alias. That is, if you use

- Alias /icons/ /usr/local/apache/icons/ + Alias "/icons/" "/usr/local/apache/icons/" -

then the url /icons will not be aliased, as it lacks +

then the URL /icons will not be aliased, as it lacks that trailing /. Likewise, if you omit the slash on the URL-path then you must also omit it from the file-path.

@@ -169,13 +169,13 @@ Alias /foo /gaq permit access to the target directory.

-Alias /image /ftp/pub/image -<Directory /ftp/pub/image> +Alias "/image" "/ftp/pub/image" +<Directory "/ftp/pub/image"> Require all granted </Directory> -

Any number slashes in the URL-path parameter +

Any number slashes in the URL-path parameter matches any number of slashes in the requested URL-path.

If the Alias directive is used within a @@ -185,11 +185,11 @@ Alias /image /ftp/pub/image using expression syntax.

-<Location /image> - Alias /ftp/pub/image +<Location "/image"> + Alias "/ftp/pub/image" </Location> -<LocationMatch /error/(?<NUMBER>[0-9]+)> - Alias /usr/local/apache/errors/%{env:MATCH_NUMBER}.html +<LocationMatch "/error/(?<NUMBER>[0-9]+)"> + Alias "/usr/local/apache/errors/%{env:MATCH_NUMBER}.html" </LocationMatch> @@ -217,7 +217,7 @@ expressions use:

- AliasMatch ^/icons(/|$)(.*) /usr/local/apache/icons$1$2 + AliasMatch "^/icons(/|$)(.*)" "/usr/local/apache/icons$1$2"

The full range of regular expression @@ -226,7 +226,7 @@ expressions matching of the URL-path:

- AliasMatch (?i)^/image(.*) /ftp/pub/image$1 + AliasMatch "(?i)^/image(.*)" "/ftp/pub/image$1"

One subtle difference @@ -251,20 +251,20 @@ expressions

For example, suppose you want to replace this with AliasMatch:

- Alias /image/ /ftp/pub/image/ + Alias "/image/" "/ftp/pub/image/"

This is NOT equivalent - don't do this! This will send all requests that have /image/ anywhere in them to /ftp/pub/image/:

- AliasMatch /image/ /ftp/pub/image/ + AliasMatch "/image/" "/ftp/pub/image/"

This is what you need to get the same effect:

- AliasMatch ^/image/(.*)$ /ftp/pub/image/$1 + AliasMatch "^/image/(.*)$" "/ftp/pub/image/$1"

Of course, there's no point in @@ -275,8 +275,8 @@ expressions serve different kinds of files from different directories:

- AliasMatch ^/image/(.*)\.jpg$ /files/jpg.images/$1.jpg
- AliasMatch ^/image/(.*)\.gif$ /files/gif.images/$1.gif + AliasMatch "^/image/(.*)\.jpg$" "/files/jpg.images/$1.jpg"
+ AliasMatch "^/image/(.*)\.gif$" "/files/gif.images/$1.gif"

Multiple leading slashes in the requested URL are discarded @@ -316,10 +316,10 @@ a different URL # Redirect to a URL on a different host -Redirect /service http://foo2.example.com/service +Redirect "/service" "http://foo2.example.com/service" # Redirect to a URL on the same host -Redirect /one /two +Redirect "/one" "/two"

If the client requests http://example.com/service/foo.txt, @@ -382,8 +382,8 @@ Redirect /one /two send_error_response in http_protocol.c).

-Redirect permanent /one http://example.com/two -Redirect 303 /three http://example.com/other +Redirect permanent "/one" "http://example.com/two" +Redirect 303 "/three" "http://example.com/other"

If the Redirect directive is used within a @@ -393,14 +393,14 @@ Redirect 303 /three http://example.com/other interpreted using expression syntax.

-<Location /one> - Redirect permanent http://example.com/two +<Location "/one"> + Redirect permanent "http://example.com/two" </Location>
-<Location /three> - Redirect 303 http://example.com/other +<Location "/three"> + Redirect 303 "http://example.com/other" </Location>
-<LocationMatch /error/(?<NUMBER>[0-9]+)> - Redirect permanent http://example.com/errors/%{env:MATCH_NUMBER}.html +<LocationMatch "/error/(?<NUMBER>[0-9]+)"> + Redirect permanent "http://example.com/errors/%{env:MATCH_NUMBER}.html" </LocationMatch>
@@ -429,7 +429,7 @@ of the current URL another server, one might use:

- RedirectMatch (.*)\.gif$ http://other.example.com$1.jpg + RedirectMatch "(.*)\.gif$" "http://other.example.com$1.jpg"

The considerations related to the difference between @@ -498,15 +498,15 @@ target as a CGI script pathname in the local filesystem.

- ScriptAlias /cgi-bin/ /web/cgi-bin/ + ScriptAlias "/cgi-bin/" "/web/cgi-bin/"

A request for http://example.com/cgi-bin/foo would cause the server to run the script /web/cgi-bin/foo. This configuration is essentially equivalent to:

-Alias /cgi-bin/ /web/cgi-bin/ -<Location /cgi-bin > +Alias "/cgi-bin/" "/web/cgi-bin/" +<Location "/cgi-bin" > SetHandler cgi-script Options +ExecCGI </Location> @@ -516,7 +516,7 @@ Alias /cgi-bin/ /web/cgi-bin/ a script or handler you have. For example:

- ScriptAlias /cgi-bin/ /web/cgi-handler.pl + ScriptAlias "/cgi-bin/" "/web/cgi-handler.pl"

In this scenario all files requested in /cgi-bin/ will be @@ -537,7 +537,7 @@ Alias /cgi-bin/ /web/cgi-bin/ module="core">SetHandler, and Options as in: -<Directory /usr/local/apache2/htdocs/cgi-bin > +<Directory "/usr/local/apache2/htdocs/cgi-bin"> SetHandler cgi-script Options ExecCGI </Directory> @@ -555,11 +555,11 @@ Alias /cgi-bin/ /web/cgi-bin/ interpreted using expression syntax.

-<Location /cgi-bin > - ScriptAlias /web/cgi-bin/ +<Location "/cgi-bin"> + ScriptAlias "/web/cgi-bin/" </Location> -<LocationMatch /cgi-bin/errors/(?<NUMBER>[0-9]+)> - ScriptAlias /web/cgi-bin/errors/%{env:MATCH_NUMBER}.cgi +<LocationMatch "/cgi-bin/errors/(?<NUMBER>[0-9]+)"> + ScriptAlias "/web/cgi-bin/errors/%{env:MATCH_NUMBER}.cgi" </LocationMatch>
@@ -588,7 +588,7 @@ and designates the target as a CGI script might use:

- ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1 + ScriptAliasMatch "^/cgi-bin(.*)" "/usr/local/apache/cgi-bin$1"

As for AliasMatch, the full range of regular @@ -597,7 +597,7 @@ and designates the target as a CGI script matching of the URL-path:

- ScriptAliasMatch (?i)^/cgi-bin(.*) /usr/local/apache/cgi-bin$1 + ScriptAliasMatch "(?i)^/cgi-bin(.*)" "/usr/local/apache/cgi-bin$1"

The considerations related to the difference between @@ -613,4 +613,3 @@ and designates the target as a CGI script - diff --git a/docs/manual/mod/mod_allowmethods.xml b/docs/manual/mod/mod_allowmethods.xml index d743b657c3..3fe9a00276 100644 --- a/docs/manual/mod/mod_allowmethods.xml +++ b/docs/manual/mod/mod_allowmethods.xml @@ -43,7 +43,7 @@ in order for it to rebuild correctly. used on an server. The most common configuration would be:

-<Location /> +<Location "/"> AllowMethods GET POST OPTIONS </Location> @@ -67,7 +67,7 @@ equivalent. The reset keyword can be used turn off mod_allowmethods in a deeper nested context:

-<Location /svn> +<Location "/svn"> AllowMethods reset </Location> diff --git a/docs/manual/mod/mod_auth_basic.xml b/docs/manual/mod/mod_auth_basic.xml index 145c504778..ed64ccd624 100644 --- a/docs/manual/mod/mod_auth_basic.xml +++ b/docs/manual/mod/mod_auth_basic.xml @@ -61,12 +61,12 @@ that the chosen provider module is present in the server.

Example -<Location /secure> +<Location "/secure"> AuthType basic AuthName "private area" AuthBasicProvider dbm AuthDBMType SDBM - AuthDBMUserFile /www/etc/dbmpasswd + AuthDBMUserFile "/www/etc/dbmpasswd" Require valid-user </Location> @@ -137,7 +137,7 @@ username and password Fixed Example -<Location /demo> +<Location "/demo"> AuthBasicFake demo demopass </Location> @@ -151,8 +151,8 @@ username and password Certificate Example -<Location /secure> - AuthBasicFake %{SSL_CLIENT_S_DN_Email} +<Location "/secure"> + AuthBasicFake "%{SSL_CLIENT_S_DN_Email}" </Location> @@ -164,15 +164,15 @@ username and password Password Example -<Location /secure> - AuthBasicFake %{SSL_CLIENT_S_DN_Email} %{sha1:passphrase-%{SSL_CLIENT_S_DN_Email}} +<Location "/secure"> + AuthBasicFake "%{SSL_CLIENT_S_DN_Email}" "%{sha1:passphrase-%{SSL_CLIENT_S_DN_Email}}" </Location> Exclusion Example -<Location /public> +<Location "/public"> AuthBasicFake off </Location> diff --git a/docs/manual/mod/mod_auth_digest.xml b/docs/manual/mod/mod_auth_digest.xml index 1d93c39e37..094750c920 100644 --- a/docs/manual/mod/mod_auth_digest.xml +++ b/docs/manual/mod/mod_auth_digest.xml @@ -64,13 +64,13 @@ Example: -<Location /private/> +<Location "/private/"> AuthType Digest AuthName "private area" - AuthDigestDomain /private/ http://mirror.my.dom/private2/ + AuthDigestDomain "/private/" "http://mirror.my.dom/private2/" AuthDigestProvider file - AuthUserFile /web/auth/.digest_pw + AuthUserFile "/web/auth/.digest_pw" Require valid-user </Location> diff --git a/docs/manual/mod/mod_auth_form.xml b/docs/manual/mod/mod_auth_form.xml index 041c3a732b..8f2dc1fe24 100644 --- a/docs/manual/mod/mod_auth_form.xml +++ b/docs/manual/mod/mod_auth_form.xml @@ -76,10 +76,10 @@ Basic example AuthFormProvider file -AuthUserFile conf/passwd +AuthUserFile "conf/passwd" AuthType form AuthName realm -AuthFormLoginRequiredLocation http://example.com/login.html +AuthFormLoginRequiredLocation "http://example.com/login.html" Session On SessionCookieName session path=/ SessionCryptoPassphrase secret @@ -133,12 +133,12 @@ SessionCryptoPassphrase secret Form login handler example -<Location /dologin.html> +<Location "/dologin.html"> SetHandler form-login-handler - AuthFormLoginRequiredLocation http://example.com/login.html - AuthFormLoginSuccessLocation http://example.com/success.html + AuthFormLoginRequiredLocation "http://example.com/login.html" + AuthFormLoginSuccessLocation "http://example.com/success.html" AuthFormProvider file - AuthUserFile conf/passwd + AuthUserFile "conf/passwd" AuthType form AuthName realm Session On @@ -201,11 +201,11 @@ SessionCryptoPassphrase secret Basic inline example AuthFormProvider file -ErrorDocument 401 /login.shtml -AuthUserFile conf/passwd +ErrorDocument 401 "/login.shtml" +AuthUserFile "conf/passwd" AuthType form AuthName realm -AuthFormLoginRequiredLocation http://example.com/login.html +AuthFormLoginRequiredLocation "http://example.com/login.html" Session On SessionCookieName session path=/ SessionCryptoPassphrase secret @@ -280,7 +280,7 @@ SessionCryptoPassphrase secret CGI example AuthFormProvider file - ErrorDocument 401 /cgi-bin/login.cgi + ErrorDocument 401 "/cgi-bin/login.cgi" ... @@ -304,7 +304,7 @@ SessionCryptoPassphrase secret SetHandler form-logout-handler AuthName realm -AuthFormLogoutLocation http://example.com/loggedout.html +AuthFormLogoutLocation "http://example.com/loggedout.html" Session On SessionCookieName session path=/ SessionCryptoPassphrase secret @@ -322,7 +322,7 @@ SessionCryptoPassphrase secret Basic session expiry example SetHandler form-logout-handler -AuthFormLogoutLocation http://example.com/loggedout.html +AuthFormLogoutLocation "http://example.com/loggedout.html" Session On SessionMaxAge 1 SessionCookieName session path=/ @@ -358,12 +358,12 @@ SessionCryptoPassphrase secret Example -<Location /secure> +<Location "/secure"> AuthType form AuthName "private area" AuthFormProvider dbm AuthDBMType SDBM - AuthDBMUserFile /www/etc/dbmpasswd + AuthDBMUserFile "/www/etc/dbmpasswd" Require valid-user #... </Location> @@ -634,9 +634,9 @@ parser has been added in 2.4.4. Example -<Location /logout> +<Location "/logout"> SetHandler form-logout-handler - AuthFormLogoutLocation http://example.com/loggedout.html + AuthFormLogoutLocation "http://example.com/loggedout.html" Session on #... </Location> diff --git a/docs/manual/mod/mod_authn_anon.xml b/docs/manual/mod/mod_authn_anon.xml index 47abb94dd3..0078c6ee5c 100644 --- a/docs/manual/mod/mod_authn_anon.xml +++ b/docs/manual/mod/mod_authn_anon.xml @@ -82,11 +82,11 @@ Example -<Directory /var/www/html/private> +<Directory "/var/www/html/private"> AuthName "Use 'anonymous' & Email address for guest entry" AuthType Basic AuthBasicProvider file anon - AuthUserFile /path/to/your/.htpasswd + AuthUserFile "/path/to/your/.htpasswd" Anonymous_NoUserID off Anonymous_MustGiveEmail on diff --git a/docs/manual/mod/mod_authn_core.xml b/docs/manual/mod/mod_authn_core.xml index f270ca14de..676e08fcac 100644 --- a/docs/manual/mod/mod_authn_core.xml +++ b/docs/manual/mod/mod_authn_core.xml @@ -57,15 +57,15 @@ # Check here first <AuthnProviderAlias file file1> - AuthUserFile /www/conf/passwords1 + AuthUserFile "/www/conf/passwords1" </AuthnProviderAlias> # Then check here <AuthnProviderAlias file file2> - AuthUserFile /www/conf/passwords2 + AuthUserFile "/www/conf/passwords2" </AuthnProviderAlias> -<Directory /var/web/pages/secure> +<Directory "/var/web/pages/secure"> AuthBasicProvider file1 file2 AuthType Basic @@ -93,8 +93,8 @@ AuthLDAPURL ldap://other.ldap.host/o=dev?cn </AuthnProviderAlias> -Alias /secure /webpages/secure -<Directory /webpages/secure> +Alias "/secure" "/webpages/secure" +<Directory "/webpages/secure"> Order deny,allow Allow from all @@ -184,15 +184,15 @@ authentication /www/docs/public directory without authenticating:

-<Directory /www/docs> +<Directory "/www/docs"> AuthType Basic AuthName Documents AuthBasicProvider file - AuthUserFile /usr/local/apache/passwd/passwords + AuthUserFile "/usr/local/apache/passwd/passwords" Require valid-user </Directory> -<Directory /www/docs/public> +<Directory "/www/docs/public"> AuthType None Require all granted </Directory> diff --git a/docs/manual/mod/mod_authn_dbd.xml b/docs/manual/mod/mod_authn_dbd.xml index 69211cbed1..e82c6dc151 100644 --- a/docs/manual/mod/mod_authn_dbd.xml +++ b/docs/manual/mod/mod_authn_dbd.xml @@ -83,7 +83,7 @@ DBDKeep 8 DBDMax 20 DBDExptime 300 -<Directory /usr/www/myhost/private> +<Directory "/usr/www/myhost/private"> # mod_authn_core and mod_auth_basic configuration # for mod_authn_dbd AuthType Basic diff --git a/docs/manual/mod/mod_authn_socache.xml b/docs/manual/mod/mod_authn_socache.xml index b5d3254f72..e371841388 100644 --- a/docs/manual/mod/mod_authn_socache.xml +++ b/docs/manual/mod/mod_authn_socache.xml @@ -72,7 +72,7 @@ the load on backends #AuthnCacheSOCache is optional. If specified, it is server-wide AuthnCacheSOCache dbm -<Directory /usr/www/myhost/private> +<Directory "/usr/www/myhost/private"> AuthType Basic AuthName "Cached Authentication Example" AuthBasicProvider socache dbd diff --git a/docs/manual/mod/mod_authnz_fcgi.xml b/docs/manual/mod/mod_authnz_fcgi.xml index 5cefa686e9..8430e6feb7 100644 --- a/docs/manual/mod/mod_authnz_fcgi.xml +++ b/docs/manual/mod/mod_authnz_fcgi.xml @@ -110,7 +110,7 @@ while (FCGI::accept >= 0) { Example configuration: AuthnzFcgiDefineProvider authn FooAuthn fcgi://localhost:10102/ -<Location /protected/> +<Location "/protected/"> AuthType Basic AuthName "Restricted" AuthBasicProvider FooAuthn @@ -153,7 +153,7 @@ while (FCGI::accept >= 0) { Example configuration: AuthnzFcgiDefineProvider authz FooAuthz fcgi://localhost:10103/ -<Location /protected/> +<Location "/protected/"> AuthType ... AuthName ... AuthBasicProvider ... @@ -206,7 +206,7 @@ while (FCGI::accept >= 0) { Example configuration: AuthnzFcgiDefineProvider authnz FooAuthnz fcgi://localhost:10103/ -<Location /protected/> +<Location "/protected/"> AuthType Basic AuthName "Restricted" AuthBasicProvider FooAuthnz @@ -257,7 +257,7 @@ while (FCGI::accept >= 0) { Example configuration: AuthnzFcgiDefineProvider authn FooAuthn fcgi://localhost:10103/ -<Location /protected/> +<Location "/protected/"> AuthType ... AuthName ... AuthnzFcgiCheckAuthnProvider FooAuthn \ diff --git a/docs/manual/mod/mod_authnz_ldap.xml b/docs/manual/mod/mod_authnz_ldap.xml index df2bd2d71f..70695f5181 100644 --- a/docs/manual/mod/mod_authnz_ldap.xml +++ b/docs/manual/mod/mod_authnz_ldap.xml @@ -705,8 +705,8 @@ AuthLDAPURL ldap://10.0.0.1:3268/?userPrincipalName?sub that gets created in the web

AuthLDAPURL "the url" -AuthGroupFile mygroupfile -Require group mygroupfile +AuthGroupFile "mygroupfile" +Require group "mygroupfile"
How It Works diff --git a/docs/manual/mod/mod_authz_core.xml b/docs/manual/mod/mod_authz_core.xml index ede7dbad17..1ce4cfcc82 100644 --- a/docs/manual/mod/mod_authz_core.xml +++ b/docs/manual/mod/mod_authz_core.xml @@ -71,8 +71,8 @@ AuthLDAPURL ldap://other.ldap.host/o=dev?cn </AuthzProviderAlias> -Alias /secure /webpages/secure -<Directory /webpages/secure> +Alias "/secure" "/webpages/secure" +<Directory "/webpages/secure"> Require all granted AuthBasicProvider file @@ -111,7 +111,7 @@ Alias /secure /webpages/secure LDAP group Temporary Employees.

-<Directory /www/mydocs> +<Directory "/www/mydocs"> <RequireAll> <RequireAny> Require user superadmin @@ -156,7 +156,7 @@ Alias /secure /webpages/secure SetEnvIf User-Agent ^KnockKnock/2\.0 let_me_in -<Directory /docroot> +<Directory "/docroot"> Require env let_me_in </Directory> @@ -332,8 +332,8 @@ an authorization provider. AuthType Basic AuthName "Restricted Resource" AuthBasicProvider file -AuthUserFile /web/users -AuthGroupFile /web/groups +AuthUserFile "/web/users" +AuthGroupFile "/web/groups" Require group admin @@ -358,7 +358,7 @@ Require group admin are also in the reject group.

-<Directory /www/docs> +<Directory "/www/docs"> <RequireAll> Require group alpha beta Require not group reject @@ -556,20 +556,20 @@ sections. gamma may access /www/docs/ab/gamma. -<Directory /www/docs> +<Directory "/www/docs"> AuthType Basic AuthName Documents AuthBasicProvider file - AuthUserFile /usr/local/apache/passwd/passwords + AuthUserFile "/usr/local/apache/passwd/passwords" Require group alpha </Directory> -<Directory /www/docs/ab> +<Directory "/www/docs/ab"> AuthMerging Or Require group beta </Directory> -<Directory /www/docs/ab/gamma> +<Directory "/www/docs/ab/gamma"> Require group gamma </Directory> diff --git a/docs/manual/mod/mod_authz_dbd.xml b/docs/manual/mod/mod_authz_dbd.xml index 982221c55e..84717c396a 100644 --- a/docs/manual/mod/mod_authz_dbd.xml +++ b/docs/manual/mod/mod_authz_dbd.xml @@ -140,7 +140,7 @@ DBDKeep 8 DBDMax 20 DBDExptime 300 -<Directory /usr/www/my.site/team-private/> +<Directory "/usr/www/my.site/team-private/"> # mod_authn_core and mod_auth_basic configuration # for mod_authn_dbd AuthType Basic @@ -160,9 +160,9 @@ DBDExptime 300 # when a user fails to be authenticated or authorized, # invite them to login; this page should provide a link # to /team-private/login.html - ErrorDocument 401 /login-info.html + ErrorDocument 401 "/login-info.html" - <Files login.html> + <Files "login.html"> # don't require user to already be logged in! AuthDBDUserPWQuery "SELECT password FROM authn WHERE user = %s" @@ -175,7 +175,7 @@ DBDExptime 300 AuthzDBDLoginToReferer On </Files> - <Files logout.html> + <Files "logout.html"> # dbd-logout action executes a statement to log user out Require dbd-logout AuthzDBDQuery "UPDATE authn SET login = 'false' WHERE user = %s" diff --git a/docs/manual/mod/mod_authz_dbm.xml b/docs/manual/mod/mod_authz_dbm.xml index cb727b8799..c0e1d13d4b 100644 --- a/docs/manual/mod/mod_authz_dbm.xml +++ b/docs/manual/mod/mod_authz_dbm.xml @@ -74,17 +74,17 @@
Example usage -

Note that using mod_authz_dbm requires you to require dbm-group +

Note that using mod_authz_dbm requires you to require dbm-group instead of group:

<Directory "/foo/bar"> - AuthType Basic + AuthType Basic AuthName "Secure Area" - AuthBasicProvider dbm - AuthDBMUserFile site/data/users - AuthDBMGroupFile site/data/users - Require dbm-group admin + AuthBasicProvider dbm + AuthDBMUserFile "site/data/users" + AuthDBMGroupFile "site/data/users" + Require dbm-group admin </Directory>
@@ -127,8 +127,8 @@ of user groups for authorization point to the same DBM:

-AuthDBMGroupFile /www/userbase -AuthDBMUserFile /www/userbase +AuthDBMGroupFile "/www/userbase" +AuthDBMUserFile "/www/userbase"

The key for the single DBM is the username. The value consists diff --git a/docs/manual/mod/mod_authz_owner.xml b/docs/manual/mod/mod_authz_owner.xml index 475cc7d9f5..0c6190c9e8 100644 --- a/docs/manual/mod/mod_authz_owner.xml +++ b/docs/manual/mod/mod_authz_owner.xml @@ -86,11 +86,11 @@ were owned by jones instead of smith.

-<Directory /home/*/public_html/private> +<Directory "/home/*/public_html/private"> AuthType Basic AuthName MyPrivateFiles AuthBasicProvider dbm - AuthDBMUserFile /usr/local/apache2/etc/.htdbm-all + AuthDBMUserFile "/usr/local/apache2/etc/.htdbm-all" Require file-owner </Directory> @@ -110,14 +110,14 @@ each other.

-<Directory /home/*/public_html/project-foo> +<Directory "/home/*/public_html/project-foo"> AuthType Basic AuthName "Project Foo Files" AuthBasicProvider dbm # combined user/group database - AuthDBMUserFile /usr/local/apache2/etc/.htdbm-all - AuthDBMGroupFile /usr/local/apache2/etc/.htdbm-all + AuthDBMUserFile "/usr/local/apache2/etc/.htdbm-all" + AuthDBMGroupFile "/usr/local/apache2/etc/.htdbm-all" Satisfy All Require file-group diff --git a/docs/manual/mod/mod_autoindex.xml b/docs/manual/mod/mod_autoindex.xml index 0f117fccda..732e161b14 100644 --- a/docs/manual/mod/mod_autoindex.xml +++ b/docs/manual/mod/mod_autoindex.xml @@ -563,10 +563,10 @@ a directory inherited from other configuration sections.

-<Directory /var/www> +<Directory "/var/www"> IndexIgnore *.bak .??* *~ *# HEADER* README* RCS CVS *,v *,t </Directory> -<Directory /var/www/backups> +<Directory "/var/www/backups"> IndexIgnoreReset ON IndexIgnore .??* *# HEADER* README* RCS CVS *,v *,t </Directory> @@ -921,7 +921,7 @@ indexing single directory are now merged together. The result of: -<Directory /foo> +<Directory "/foo"> IndexOptions HTMLTable IndexOptions SuppressColumnsorting </Directory> diff --git a/docs/manual/mod/mod_cache.xml b/docs/manual/mod/mod_cache.xml index 8df6864d8d..a5e9080ba2 100644 --- a/docs/manual/mod/mod_cache.xml +++ b/docs/manual/mod/mod_cache.xml @@ -157,14 +157,14 @@ LoadModule cache_module modules/mod_cache.so <IfModule mod_cache.c> LoadModule cache_disk_module modules/mod_cache_disk.so <IfModule mod_cache_disk.c> - CacheRoot c:/cacheroot - CacheEnable disk / + CacheRoot "c:/cacheroot" + CacheEnable disk "/" CacheDirLevels 5 CacheDirLength 3 </IfModule> # When acting as a proxy, don't cache the list of security updates - CacheDisable http://security.update.server/update-list/ + CacheDisable "http://security.update.server/update-list/" </IfModule> @@ -226,7 +226,7 @@ LoadModule cache_module modules/mod_cache.so # <IfModule mod_cache.c> CacheLock on - CacheLockPath /tmp/mod_cache-lock + CacheLockPath "/tmp/mod_cache-lock" CacheLockMaxAge 5 </IfModule> @@ -327,10 +327,10 @@ AddOutputFilterByType INCLUDES;CACHE;DEFLATE text/html as per the following example:

-CustomLog cached-requests.log common env=cache-hit -CustomLog uncached-requests.log common env=cache-miss -CustomLog revalidated-requests.log common env=cache-revalidate -CustomLog invalidated-requests.log common env=cache-invalidate +CustomLog "cached-requests.log" common env=cache-hit +CustomLog "uncached-requests.log" common env=cache-miss +CustomLog "revalidated-requests.log" common env=cache-revalidate +CustomLog "invalidated-requests.log" common env=cache-invalidate

For module authors, a hook called cache_status is available, @@ -380,13 +380,13 @@ manager # Cache content (normal handler only) CacheQuickHandler off -<Location /foo> +<Location "/foo"> CacheEnable disk </Location> # Cache regex (normal handler only) CacheQuickHandler off -<LocationMatch foo$> +<LocationMatch "foo$"> CacheEnable disk </LocationMatch> @@ -406,9 +406,9 @@ CacheEnable disk http://www.example.org/ # Match www.example.org, and fooexample.org -CacheEnable disk http://*example.org/ +CacheEnable disk "http://*example.org/" # Match www.example.org, but not fooexample.org -CacheEnable disk http://.example.org/ +CacheEnable disk "http://.example.org/"

The no-cache environment variable can be set to @@ -434,7 +434,7 @@ CacheEnable disk http://.example.org/ Example - CacheDisable /local_files + CacheDisable "/local_files" @@ -444,7 +444,7 @@ CacheEnable disk http://.example.org/ Example -<Location /foo> +<Location "/foo"> CacheDisable on </Location> @@ -1055,7 +1055,7 @@ CacheDetailHeader on # Override the base URL of the cache key. -CacheKeyBaseURL http://www.example.com/ +CacheKeyBaseURL "http://www.example.com/" Take care when setting this directive. If two separate virtual diff --git a/docs/manual/mod/mod_charset_lite.xml b/docs/manual/mod/mod_charset_lite.xml index 31516532e2..bcecf75e0f 100644 --- a/docs/manual/mod/mod_charset_lite.xml +++ b/docs/manual/mod/mod_charset_lite.xml @@ -103,7 +103,7 @@ Example -<Directory /export/home/trawick/apacheinst/htdocs/convert> +<Directory "/export/home/trawick/apacheinst/htdocs/convert"> CharsetSourceEnc UTF-16BE CharsetDefault ISO-8859-1 </Directory> @@ -144,7 +144,7 @@ Example -<Directory /export/home/trawick/apacheinst/htdocs/convert> +<Directory "/export/home/trawick/apacheinst/htdocs/convert"> CharsetSourceEnc UTF-16BE CharsetDefault ISO-8859-1 </Directory> diff --git a/docs/manual/mod/mod_data.xml b/docs/manual/mod/mod_data.xml index 51b9b58e7f..b4852fba15 100644 --- a/docs/manual/mod/mod_data.xml +++ b/docs/manual/mod/mod_data.xml @@ -57,7 +57,7 @@ Configuring the filter -<Location /data/images> +<Location "/data/images"> SetOutputFilter DATA </Location> diff --git a/docs/manual/mod/mod_dav.xml b/docs/manual/mod/mod_dav.xml index 2d202c0eb3..c4eb0bb4da 100644 --- a/docs/manual/mod/mod_dav.xml +++ b/docs/manual/mod/mod_dav.xml @@ -78,15 +78,15 @@ Full Example -DavLockDB /usr/local/apache2/var/DavLock +DavLockDB "/usr/local/apache2/var/DavLock" -<Directory /usr/local/apache2/htdocs/foo> +<Directory "/usr/local/apache2/htdocs/foo"> Require all granted Dav On AuthType Basic AuthName DAV - AuthUserFile user.passwd + AuthUserFile "user.passwd" <LimitExcept GET POST OPTIONS> Require user admin @@ -149,9 +149,9 @@ DavLockDB /usr/local/apache2/var/DavLock downloaded and manipulated with DAV.

-Alias /phparea /home/gstein/php_files -Alias /php-source /home/gstein/php_files -<Location /php-source> +Alias "/phparea" "/home/gstein/php_files" +Alias "/php-source" "/home/gstein/php_files" +<Location "/php-source"> Dav On ForceType text/plain </Location> @@ -175,7 +175,7 @@ Alias /php-source /home/gstein/php_files WebDAV HTTP methods for the given container:

-<Location /foo> +<Location "/foo"> Dav On </Location> @@ -218,7 +218,7 @@ a DAV resource Example -<Location /MSWord> +<Location "/MSWord"> DavMinTimeout 600 </Location> diff --git a/docs/manual/mod/mod_dav_fs.xml b/docs/manual/mod/mod_dav_fs.xml index 5fbf72158c..224bdd05c5 100644 --- a/docs/manual/mod/mod_dav_fs.xml +++ b/docs/manual/mod/mod_dav_fs.xml @@ -70,8 +70,8 @@ Example - DavLockDB var/DavLock - + DavLockDB "var/DavLock" +

The directory containing the lock database file must be diff --git a/docs/manual/mod/mod_deflate.xml b/docs/manual/mod/mod_deflate.xml index 083ed62e08..e6db1f1717 100644 --- a/docs/manual/mod/mod_deflate.xml +++ b/docs/manual/mod/mod_deflate.xml @@ -68,7 +68,7 @@ client SetOutputFilter DEFLATE -SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip +SetEnvIfNoCase Request_URI "\.(?:gif|jpe?g|png)$" no-gzip

If you want to restrict the compression to particular MIME types @@ -104,8 +104,8 @@ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip >AddOutputFilter, for example:

-<Location /dav-area> - ProxyPass http://example.com/ +<Location "/dav-area"> + ProxyPass "http://example.com/" SetOutputFilter INFLATE </Location> @@ -124,7 +124,7 @@ SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip >AddInputFilter, for example:

-<Location /dav-area> +<Location "/dav-area"> SetInputFilter DEFLATE </Location> @@ -191,20 +191,20 @@ content <IfModule mod_headers.c> # Serve gzip compressed CSS files if they exist # and the client accepts gzip. - RewriteCond %{HTTP:Accept-encoding} gzip - RewriteCond %{REQUEST_FILENAME}\.gz -s - RewriteRule ^(.*)\.css $1\.css\.gz [QSA] + RewriteCond "%{HTTP:Accept-encoding}" "gzip" + RewriteCond "%{REQUEST_FILENAME}\.gz" -s + RewriteRule "^(.*)\.css" "$1\.css\.gz" [QSA] # Serve gzip compressed JS files if they exist # and the client accepts gzip. - RewriteCond %{HTTP:Accept-encoding} gzip - RewriteCond %{REQUEST_FILENAME}\.gz -s - RewriteRule ^(.*)\.js $1\.js\.gz [QSA] + RewriteCond "%{HTTP:Accept-encoding}" "gzip" + RewriteCond "%{REQUEST_FILENAME}\.gz" -s + RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA] # Serve correct content types, and prevent mod_deflate double gzip. - RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1] - RewriteRule \.js\.gz$ - [T=text/javascript,E=no-gzip:1] + RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1] + RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1] <FilesMatch "(\.js\.gz|\.css\.gz)$"> @@ -240,7 +240,7 @@ content DeflateFilterNote ratio LogFormat '"%r" %b (%{ratio}n) "%{User-agent}i"' deflate - CustomLog logs/deflate_log deflate + CustomLog "logs/deflate_log" deflate
@@ -270,7 +270,7 @@ DeflateFilterNote Output outstream DeflateFilterNote Ratio ratio LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate -CustomLog logs/deflate_log deflate +CustomLog "logs/deflate_log" deflate
diff --git a/docs/manual/mod/mod_dialup.xml b/docs/manual/mod/mod_dialup.xml index c8fdf53808..4b1ee4250f 100644 --- a/docs/manual/mod/mod_dialup.xml +++ b/docs/manual/mod/mod_dialup.xml @@ -37,8 +37,8 @@ by the various old modem standards. So, you can browse your site with a 56k V.92 modem, by adding something like this:

-<Location /mysite> - ModemStandard V.92 +<Location "/mysite"> + ModemStandard "V.92" </Location> @@ -59,8 +59,8 @@ once the timer hits. From there the handler can continue to send data to the cl

Specify what modem standard you wish to simulate.

-<Location /mysite> - ModemStandard V.26bis +<Location "/mysite"> + ModemStandard "V.26bis" </Location> diff --git a/docs/manual/mod/mod_dir.html.en b/docs/manual/mod/mod_dir.html.en index 24f2955875..065b1881dc 100644 --- a/docs/manual/mod/mod_dir.html.en +++ b/docs/manual/mod/mod_dir.html.en @@ -148,19 +148,19 @@ a directory to the list of resources to look for rather than replace:

# Example A: Set index.html as an index page, then add index.php to that list as well.
-<Directory /foo>
+<Directory "/foo">
     DirectoryIndex index.html
     DirectoryIndex index.php
 </Directory>
 
 # Example B: This is identical to example A, except it's done with a single directive.
-<Directory /foo>
+<Directory "/foo">
     DirectoryIndex index.html index.php
 </Directory>
 
 # Example C: To replace the list, you must explicitly reset it first:
 # In this example, only index.php will remain as an index resource.
-<Directory /foo>
+<Directory "/foo">
     DirectoryIndex index.html
     DirectoryIndex disabled
     DirectoryIndex index.php
@@ -298,10 +298,10 @@ later
     if inheritance from a parent directory is not desired.

In a sub-URI, such as http://example.com/blog/ this sub-URI has to be supplied as local-url:

-
<Directory /web/example.com/htdocs/blog>
+    
<Directory "/web/example.com/htdocs/blog">
     FallbackResource /blog/index.php
 </Directory>
-<Directory /web/example.com/htdocs/blog/images>
+<Directory "/web/example.com/htdocs/blog/images">
     FallbackResource disabled
 </Directory>
diff --git a/docs/manual/mod/mod_dir.xml b/docs/manual/mod/mod_dir.xml index 58119a66ed..bd34de7087 100644 --- a/docs/manual/mod/mod_dir.xml +++ b/docs/manual/mod/mod_dir.xml @@ -108,19 +108,19 @@ a directory

# Example A: Set index.html as an index page, then add index.php to that list as well. -<Directory /foo> +<Directory "/foo"> DirectoryIndex index.html DirectoryIndex index.php </Directory> # Example B: This is identical to example A, except it's done with a single directive. -<Directory /foo> +<Directory "/foo"> DirectoryIndex index.html index.php </Directory> # Example C: To replace the list, you must explicitly reset it first: # In this example, only index.php will remain as an index resource. -<Directory /foo> +<Directory "/foo"> DirectoryIndex index.html DirectoryIndex disabled DirectoryIndex index.php @@ -209,7 +209,7 @@ a directory # see security warning below! -<Location /some/path> +<Location "/some/path"> DirectorySlash Off SetHandler some-handler </Location> @@ -267,10 +267,10 @@ later

In a sub-URI, such as http://example.com/blog/ this sub-URI has to be supplied as local-url:

-<Directory /web/example.com/htdocs/blog> +<Directory "/web/example.com/htdocs/blog"> FallbackResource /blog/index.php </Directory> -<Directory /web/example.com/htdocs/blog/images> +<Directory "/web/example.com/htdocs/blog/images"> FallbackResource disabled </Directory> diff --git a/docs/manual/mod/mod_example_hooks.xml b/docs/manual/mod/mod_example_hooks.xml index dfb9655b8d..941ca2011c 100644 --- a/docs/manual/mod/mod_example_hooks.xml +++ b/docs/manual/mod/mod_example_hooks.xml @@ -100,7 +100,7 @@

To activate the example_hooks module, include a block similar to the following in your httpd.conf file:

-<Location /example-hooks-info> +<Location "/example-hooks-info"> SetHandler example-hooks-handler </Location> @@ -109,7 +109,7 @@ href="core.html#accessfilename">.htaccess file and then request the file "test.example" from that location:

- AddHandler example-hooks-handler .example + AddHandler example-hooks-handler ".example"

After reloading/restarting your server, you should be able diff --git a/docs/manual/mod/mod_ext_filter.xml b/docs/manual/mod/mod_ext_filter.xml index 75f375897d..325caf1b54 100644 --- a/docs/manual/mod/mod_ext_filter.xml +++ b/docs/manual/mod/mod_ext_filter.xml @@ -90,7 +90,7 @@ ExtFilterDefine c-to-html mode=output \ # mod_ext_filter directive to define the external filter ExtFilterDefine gzip mode=output cmd=/bin/gzip -<Location /gzipped> +<Location "/gzipped"> # core directive to cause the gzip filter to be # run on output @@ -112,7 +112,7 @@ ExtFilterDefine gzip mode=output cmd=/bin/gzip ExtFilterDefine slowdown mode=output cmd=/bin/cat \ preservescontentlength -<Location /> +<Location "/"> # core directive to cause the slowdown filter to # be run several times on output # @@ -129,7 +129,7 @@ ExtFilterDefine slowdown mode=output cmd=/bin/cat \ ExtFilterDefine fixtext mode=output intype=text/html \ cmd="/bin/sed s/verdana/arial/g" -<Location /> +<Location "/"> # core directive to cause the fixtext filter to # be run on output SetOutputFilter fixtext @@ -163,7 +163,7 @@ ExtFilterDefine traceafter \ cmd="/bin/tracefilter.pl /tmp/traceafter" \ EnableEnv=trace_this_client ftype=21 -<Directory /usr/local/docs> +<Directory "/usr/local/docs"> SetEnvIf Remote_Addr 192.168.1.31 trace_this_client SetOutputFilter tracebefore;deflate;traceafter </Directory> diff --git a/docs/manual/mod/mod_filter.xml b/docs/manual/mod/mod_filter.xml index 54e9c01bfe..4da8b72c28 100644 --- a/docs/manual/mod/mod_filter.xml +++ b/docs/manual/mod/mod_filter.xml @@ -194,7 +194,7 @@ FilterProtocol downsample "change=yes" FilterProvider repack jpeg_pack "%{CONTENT_TYPE} = 'image/jpeg'" FilterProvider repack gif_pack "%{CONTENT_TYPE} = 'image/gif'" FilterProvider repack png_pack "%{CONTENT_TYPE} = 'image/png'" -<Location /image-filter> +<Location "/image-filter"> FilterChain unpack downsample repack </Location> @@ -282,7 +282,7 @@ being moved to mod_filter in version 2.3.7 filter.

-<Location /cgi-bin/> +<Location "/cgi-bin/"> Options Includes AddOutputFilterByType INCLUDES;DEFLATE text/html </Location> diff --git a/docs/manual/mod/mod_info.xml b/docs/manual/mod/mod_info.xml index 8a1aa5b279..9aa56013f0 100644 --- a/docs/manual/mod/mod_info.xml +++ b/docs/manual/mod/mod_info.xml @@ -34,7 +34,7 @@ configuration httpd.conf file.

-<Location /server-info> +<Location "/server-info"> SetHandler server-info </Location> @@ -45,7 +45,7 @@ configuration information:

-<Location /server-info> +<Location "/server-info"> SetHandler server-info Require host example.com </Location> @@ -73,7 +73,7 @@ configuration Access control -<Location /server-info> +<Location "/server-info"> SetHandler server-info Order allow,deny # Allow access from server itself diff --git a/docs/manual/mod/mod_ldap.xml b/docs/manual/mod/mod_ldap.xml index ba17358bc1..db993d5616 100644 --- a/docs/manual/mod/mod_ldap.xml +++ b/docs/manual/mod/mod_ldap.xml @@ -70,7 +70,7 @@ LDAPCacheTTL 600 LDAPOpCacheEntries 1024 LDAPOpCacheTTL 600 -<Location /ldap-status> +<Location "/ldap-status"> SetHandler ldap-status Require host yourdomain.example.com @@ -79,7 +79,7 @@ LDAPOpCacheTTL 600 AuthType Basic AuthName "LDAP Protected" AuthBasicProvider ldap - AuthLDAPURL ldap://127.0.0.1/dc=example,dc=com?uid?one + AuthLDAPURL "ldap://127.0.0.1/dc=example,dc=com?uid?one" Require valid-user </Location> @@ -179,7 +179,7 @@ LDAPOpCacheTTL 600 mod_ldap cache information:

-<Location /server/cache-info> +<Location "/server/cache-info"> SetHandler ldap-status </Location> @@ -210,9 +210,9 @@ LDAPOpCacheTTL 600 # mod_ldap and mod_authnz_ldap be loaded. Change the # "yourdomain.example.com" to match your domain. -LDAPTrustedGlobalCert CA_DER /certs/certfile.der +LDAPTrustedGlobalCert CA_DER "/certs/certfile.der" -<Location /ldap-status> +<Location "/ldap-status"> SetHandler ldap-status Require host yourdomain.example.com @@ -221,7 +221,7 @@ LDAPTrustedGlobalCert CA_DER /certs/certfile.der AuthType Basic AuthName "LDAP Protected" AuthBasicProvider ldap - AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one + AuthLDAPURL "ldaps://127.0.0.1/dc=example,dc=com?uid?one" Require valid-user </Location>
@@ -231,9 +231,9 @@ LDAPTrustedGlobalCert CA_DER /certs/certfile.der # mod_ldap and mod_authnz_ldap be loaded. Change the # "yourdomain.example.com" to match your domain. -LDAPTrustedGlobalCert CA_DER /certs/certfile.der +LDAPTrustedGlobalCert CA_DER "/certs/certfile.der: -<Location /ldap-status> +<Location "/ldap-status"> SetHandler ldap-status Require host yourdomain.example.com @@ -242,7 +242,7 @@ LDAPTrustedGlobalCert CA_DER /certs/certfile.der AuthType Basic AuthName "LDAP Protected" AuthBasicProvider ldap - AuthLDAPURL ldap://127.0.0.1/dc=example,dc=com?uid?one TLS + AuthLDAPURL "ldap://127.0.0.1/dc=example,dc=com?uid?one" TLS Require valid-user </Location>
@@ -280,12 +280,12 @@ LDAPTrustedGlobalCert CA_DER /certs/certfile.der # Specify a Netscape CA certificate file -LDAPTrustedGlobalCert CA_CERT7_DB /certs/cert7.db +LDAPTrustedGlobalCert CA_CERT7_DB "/certs/cert7.db" # Specify an optional key3.db file for client certificate support -LDAPTrustedGlobalCert CERT_KEY3_DB /certs/key3.db +LDAPTrustedGlobalCert CERT_KEY3_DB "/certs/key3.db" # Specify the secmod file if required -LDAPTrustedGlobalCert CA_SECMOD /certs/secmod -<Location /ldap-status> +LDAPTrustedGlobalCert CA_SECMOD "/certs/secmod" +<Location "/ldap-status"> SetHandler ldap-status Require host yourdomain.example.com @@ -295,7 +295,7 @@ LDAPTrustedGlobalCert CA_SECMOD /certs/secmod AuthName "LDAP Protected" AuthBasicProvider ldap LDAPTrustedClientCert CERT_NICKNAME <nickname> [password] - AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one + AuthLDAPURL "ldaps://127.0.0.1/dc=example,dc=com?uid?one" Require valid-user </Location> @@ -320,13 +320,13 @@ LDAPTrustedGlobalCert CA_SECMOD /certs/secmod # Specify two CA certificate files -LDAPTrustedGlobalCert CA_DER /certs/cacert1.der -LDAPTrustedGlobalCert CA_BASE64 /certs/cacert2.pem +LDAPTrustedGlobalCert CA_DER "/certs/cacert1.der" +LDAPTrustedGlobalCert CA_BASE64 "/certs/cacert2.pem" # Specify a client certificate file and key -LDAPTrustedGlobalCert CERT_BASE64 /certs/cert1.pem -LDAPTrustedGlobalCert KEY_BASE64 /certs/key1.pem [password] +LDAPTrustedGlobalCert CERT_BASE64 "/certs/cert1.pem" +LDAPTrustedGlobalCert KEY_BASE64 "/certs/key1.pem" [password] # Do not use this directive, as it will throw an error -#LDAPTrustedClientCert CERT_BASE64 /certs/cert1.pem +#LDAPTrustedClientCert CERT_BASE64 "/certs/cert1.pem"
@@ -352,23 +352,23 @@ LDAPTrustedGlobalCert KEY_BASE64 /certs/key1.pem [password] # Specify two CA certificate files -LDAPTrustedGlobalCert CA_DER /certs/cacert1.der -LDAPTrustedGlobalCert CA_BASE64 /certs/cacert2.pem -<Location /ldap-status> +LDAPTrustedGlobalCert CA_DER "/certs/cacert1.der" +LDAPTrustedGlobalCert CA_BASE64 "/certs/cacert2.pem" +<Location "/ldap-status"> SetHandler ldap-status Require host yourdomain.example.com - LDAPTrustedClientCert CERT_BASE64 /certs/cert1.pem - LDAPTrustedClientCert KEY_BASE64 /certs/key1.pem + LDAPTrustedClientCert CERT_BASE64 "/certs/cert1.pem" + LDAPTrustedClientCert KEY_BASE64 "/certs/key1.pem" # CA certs respecified due to per-directory client certs - LDAPTrustedClientCert CA_DER /certs/cacert1.der - LDAPTrustedClientCert CA_BASE64 /certs/cacert2.pem + LDAPTrustedClientCert CA_DER "/certs/cacert1.der" + LDAPTrustedClientCert CA_BASE64 "/certs/cacert2.pem" Satisfy any AuthType Basic AuthName "LDAP Protected" AuthBasicProvider ldap - AuthLDAPURL ldaps://127.0.0.1/dc=example,dc=com?uid?one + AuthLDAPURL "ldaps://127.0.0.1/dc=example,dc=com?uid?one" Require valid-user </Location> diff --git a/docs/manual/mod/mod_log_config.xml b/docs/manual/mod/mod_log_config.xml index df07a75b1e..5863d6bd0a 100644 --- a/docs/manual/mod/mod_log_config.xml +++ b/docs/manual/mod/mod_log_config.xml @@ -462,10 +462,10 @@ expr=expression] # CustomLog with format nickname LogFormat "%h %l %u %t \"%r\" %>s %b" common -CustomLog logs/access_log common +CustomLog "logs/access_log" common # CustomLog with explicit format string -CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b" +CustomLog "logs/access_log" "%h %l %u %t \"%r\" %>s %b"

The third argument is optional and controls whether or @@ -487,8 +487,8 @@ CustomLog logs/access_log "%h %l %u %t \"%r\" %>s %b" SetEnvIf Request_URI \.gif$ gif-image -CustomLog gif-requests.log common env=gif-image -CustomLog nongif-requests.log common env=!gif-image +CustomLog "gif-requests.log" common env=gif-image +CustomLog "nongif-requests.log" common env=!gif-image

Or, to reproduce the behavior of the old RefererIgnore @@ -496,7 +496,7 @@ CustomLog nongif-requests.log common env=!gif-image SetEnvIf Referer example\.com localreferer -CustomLog referer.log referer env=!localreferer +CustomLog "referer.log" referer env=!localreferer diff --git a/docs/manual/mod/mod_log_debug.xml b/docs/manual/mod/mod_log_debug.xml index ca31d2eac4..d32a0a1089 100644 --- a/docs/manual/mod/mod_log_debug.xml +++ b/docs/manual/mod/mod_log_debug.xml @@ -36,7 +36,7 @@ Log message after request to /foo/* is processed: -<Location /foo/> +<Location "/foo/">   LogMessage "/foo/ has been requested" </Location> @@ -45,7 +45,7 @@

  • Log message if request to /foo/* is processed in a sub-request: -<Location /foo/> +<Location "/foo/">   LogMessage "subrequest to /foo/" hook=type_checker expr=%{IS_SUBREQ} </Location> @@ -67,7 +67,7 @@ Log the value of the "X-Foo" request environment variable in each stage of the request: -<Location /> +<Location "/">   LogMessage "%{reqenv:X-Foo}" hook=all </Location> diff --git a/docs/manual/mod/mod_lua.xml b/docs/manual/mod/mod_lua.xml index 0673e04728..95f7a1ef24 100644 --- a/docs/manual/mod/mod_lua.xml +++ b/docs/manual/mod/mod_lua.xml @@ -71,7 +71,7 @@ module="core">SetHandler or AddHandler directive:

    -<Files *.lua> +<Files "*.lua"> SetHandler lua-script </Files> @@ -194,7 +194,7 @@ end foo and configures it for URL /:

    LuaAuthzProvider foo authz_provider.lua authz_check_foo -<Location /> +<Location "/"> Require foo 10.1.2.3 john_doe </Location> @@ -1356,7 +1356,7 @@ collectgarbage() -- close the handle via GC issues.

    Examples: - LuaMapHandler /(\w+)/(\w+) /scripts/$1.lua handle_$2 + LuaMapHandler "/(\w+)/(\w+)" "/scripts/$1.lua" "handle_$2"

    This would match uri's such as /photos/show?id=9 @@ -1365,7 +1365,7 @@ collectgarbage() -- close the handle via GC loading that file.

    - LuaMapHandler /bingo /scripts/wombat.lua + LuaMapHandler "/bingo" "/scripts/wombat.lua"

    This would invoke the "handle" function, which is the default if no specific function name is @@ -1387,8 +1387,8 @@ collectgarbage() -- close the handle via GC Examples: -LuaPackagePath /scripts/lib/?.lua -LuaPackagePath /scripts/lib/?/init.lua +LuaPackagePath "/scripts/lib/?.lua" +LuaPackagePath "/scripts/lib/?/init.lua" @@ -1472,7 +1472,7 @@ LuaCodeCache never # httpd.conf -LuaHookTranslateName /scripts/conf/hooks.lua silly_mapper +LuaHookTranslateName "/scripts/conf/hooks.lua" silly_mapper @@ -1535,7 +1535,7 @@ processing

    Example:

    -LuaHookLog /path/to/script.lua logger +LuaHookLog "/path/to/script.lua" logger -- /path/to/script.lua -- @@ -1577,7 +1577,7 @@ end map-to-storage phase of a request. Modules like mod_cache run at this phase, which makes for an interesting example on what to do here:

    - LuaHookMapToStorage /path/to/lua/script.lua check_cache + LuaHookMapToStorage "/path/to/lua/script.lua" check_cache require"apache2" @@ -1643,7 +1643,7 @@ end be used to modify the type and handler based on input:

    - LuaHookTypeChecker /path/to/lua/script.lua type_checker + LuaHookTypeChecker "/path/to/lua/script.lua" type_checker function type_checker(r) @@ -1796,9 +1796,9 @@ hook function usually returns OK, DECLINED, or HTTP_FORBIDDEN.

    with the Require directive:

    -LuaRoot /usr/local/apache2/lua +LuaRoot "/usr/local/apache2/lua" LuaAuthzProvider foo authz.lua authz_check_foo -<Location /> +<Location "/"> Require foo johndoe </Location> @@ -1833,8 +1833,8 @@ onto the Lua script:

    -LuaInputFilter myInputFilter /www/filter.lua input_filter -<Files *.lua> +LuaInputFilter myInputFilter "/www/filter.lua" input_filter +<Files "*.lua"> SetInputFilter myInputFilter </Files> @@ -1890,8 +1890,8 @@ onto the Lua script:

    -LuaOutputFilter myOutputFilter /www/filter.lua output_filter -<Files *.lua> +LuaOutputFilter myOutputFilter "/www/filter.lua" output_filter +<Files "*.lua"> SetOutputFilter myOutputFilter </Files> diff --git a/docs/manual/mod/mod_macro.xml b/docs/manual/mod/mod_macro.xml index c938293cbc..d192db3777 100644 --- a/docs/manual/mod/mod_macro.xml +++ b/docs/manual/mod/mod_macro.xml @@ -55,9 +55,9 @@ multiple similar virtual hosts:

    ServerName $domain ServerAlias www.$domain - DocumentRoot /var/www/vhosts/$name - ErrorLog /var/log/httpd/$name.error_log - CustomLog /var/log/httpd/$name.access_log combined + DocumentRoot "/var/www/vhosts/$name" + ErrorLog "/var/log/httpd/$name.error_log" + CustomLog "/var/log/httpd/$name.access_log" combined </VirtualHost> </Macro>
    @@ -114,7 +114,7 @@ surround the parameter in braces, to avoid confusion:

    <Macro DocRoot ${docroot}> - DocumentRoot /var/www/${docroot}/htdocs + DocumentRoot "/var/www/${docroot}/htdocs" </Macro> @@ -137,15 +137,15 @@ dynamically-generated virtual hosts.

    <VirtualHost *:$port> ServerName $host - DocumentRoot $dir + DocumentRoot "$dir" # Public document root - <Directory $dir> + <Directory "$dir"> Require all granted </Directory> # limit access to intranet subdir. - <Directory $dir/intranet> + <Directory "$dir/intranet"> Require ip 10.0.0.0/8 </Directory> </VirtualHost> @@ -168,7 +168,7 @@ conflicts in variable names.

    <Macro DirGroup $dir $group> - <Directory $dir> + <Directory "$dir"> Require group $group </Directory> </Macro> diff --git a/docs/manual/mod/mod_mime.xml b/docs/manual/mod/mod_mime.xml index 95236b1e3b..e6c913e0ec 100644 --- a/docs/manual/mod/mod_mime.xml +++ b/docs/manual/mod/mod_mime.xml @@ -144,7 +144,7 @@ module="mod_mime_magic">MimeMagicFile Configure handler based on final extension only -<FilesMatch \.cgi$> +<FilesMatch "\.cgi$"> SetHandler cgi-script </FilesMatch> @@ -519,19 +519,19 @@ responses from the server # Effective filter "DEFLATE" AddOutputFilter DEFLATE shtml -<Location /foo> +<Location "/foo"> # Effective filter "INCLUDES", replacing "DEFLATE" AddOutputFilter INCLUDES shtml </Location> -<Location /bar> +<Location "/bar"> # Effective filter "INCLUDES;DEFLATE", replacing "DEFLATE" AddOutputFilter INCLUDES;DEFLATE shtml </Location> -<Location /bar/baz> +<Location "/bar/baz"> # Effective filter "BUFFER", replacing "INCLUDES;DEFLATE" AddOutputFilter BUFFER shtml </Location> -<Location /bar/baz/buz> +<Location "/bar/baz/buz"> # No effective filter, replacing "BUFFER" RemoveOutputFilter shtml </Location> @@ -792,7 +792,7 @@ extensions AddEncoding x-gzip .gz AddType text/plain .asc -<Files *.gz.asc> +<Files "*.gz.asc"> RemoveEncoding .gz </Files> diff --git a/docs/manual/mod/mod_proxy.xml b/docs/manual/mod/mod_proxy.xml index 2266ae22d3..75d4ec895b 100644 --- a/docs/manual/mod/mod_proxy.xml +++ b/docs/manual/mod/mod_proxy.xml @@ -154,8 +154,8 @@ Reverse Proxy -ProxyPass /foo http://foo.example.com/bar -ProxyPassReverse /foo http://foo.example.com/bar +ProxyPass "/foo" "http://foo.example.com/bar" +ProxyPassReverse "/foo" "http://foo.example.com/bar" @@ -164,7 +164,7 @@ ProxyPassReverse /foo http://foo.example.com/bar ProxyRequests On ProxyVia On -<Proxy *> +<Proxy "*"> Require host internal.example.com </Proxy> @@ -181,7 +181,7 @@ ProxyVia On Reverse Proxy PHP scripts -<FilesMatch \.php$> +<FilesMatch "\.php$"> # Unix sockets require 2.4.7 or later SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/" </FilesMatch> @@ -212,7 +212,7 @@ ProxyVia On for a reverse proxy:

    - ProxyPass /example http://backend.example.com connectiontimeout=5 timeout=30 + ProxyPass "/example" "http://backend.example.com" connectiontimeout=5 timeout=30

    This will create a worker associated with the origin server URL @@ -221,14 +221,14 @@ ProxyVia On via the ProxySet directive:

    - ProxySet http://backend.example.com connectiontimeout=5 timeout=30 + ProxySet "http://backend.example.com" connectiontimeout=5 timeout=30

    or alternatively using Proxy and ProxySet:

    -<Proxy http://backend.example.com> +<Proxy "http://backend.example.com"> ProxySet connectiontimeout=5 timeout=30 </Proxy> @@ -248,8 +248,8 @@ ProxyVia On origin server including any path components given:

    -ProxyPass /examples http://backend.example.com/examples -ProxyPass /docs http://backend.example.com/docs +ProxyPass "/examples" "http://backend.example.com/examples" +ProxyPass "/docs" "http://backend.example.com/docs"

    This example defines two different workers, each using a separate @@ -261,8 +261,8 @@ ProxyPass /docs http://backend.example.com/docs worker defined later in the configuration file. In the following example

    -ProxyPass /apps http://backend.example.com/ timeout=60 -ProxyPass /examples http://backend.example.com/examples timeout=10 +ProxyPass "/apps" "http://backend.example.com/" timeout=60 +ProxyPass "/examples" "http://backend.example.com/examples" timeout=10

    the second worker isn't actually created. Instead the first @@ -311,7 +311,7 @@ ProxyPass /examples http://backend.example.com/examples timeout=10 the following example:

    -<Proxy *> +<Proxy "*"> Require ip 192.168.0 </Proxy> @@ -379,8 +379,8 @@ ProxyPass /examples http://backend.example.com/examples timeout=10 proxy-nokeepalive notes.

    -<Location /buggyappserver/> - ProxyPass http://buggyappserver:7001/foo/ +<Location "/buggyappserver/"> + ProxyPass "http://buggyappserver:7001/foo/" SetEnv force-proxy-request-1.0 1 SetEnv proxy-nokeepalive 1 </Location> @@ -476,7 +476,7 @@ ProxyPass /examples http://backend.example.com/examples timeout=10 server:

    -<Proxy *> +<Proxy "*"> Require host yournetwork.example.com </Proxy> @@ -486,7 +486,7 @@ ProxyPass /examples http://backend.example.com/examples timeout=10 filter when they are sent through the proxy server:

    -<Proxy http://example.com/foo/*> +<Proxy "http://example.com/foo/*"> SetOutputFilter INCLUDES </Proxy> @@ -495,7 +495,7 @@ ProxyPass /examples http://backend.example.com/examples timeout=10

    A backend URL matches the configuration section if it begins with the the wildcard-url string, even if the last path segment in the directive only matches a prefix of the backend URL. For example, - <Proxy http://example.com/foo> matches all of + <Proxy "http://example.com/foo"> matches all of http://example.com/foo, http://example.com/foo/bar, and http://example.com/foobar. The matching of the final URL differs from the behavior of the (unnamed) backreferences are ignored. Use named groups instead.

    -<ProxyMatch ^http://(?<sitename>[^/]+)> +<ProxyMatch "^http://(?<sitename>[^/]+)"> Require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example </ProxyMatch> @@ -654,9 +654,9 @@ context in 2.3.3 and later. Example -ProxyRemote http://goodguys.example.com/ http://mirrorguys.example.com:8000 -ProxyRemote * http://cleverproxy.localdomain -ProxyRemote ftp http://ftpproxy.mydomain:8080 +ProxyRemote "http://goodguys.example.com/" "http://mirrorguys.example.com:8000" +ProxyRemote "*" "http://cleverproxy.localdomain" +ProxyRemote "ftp" "http://ftpproxy.mydomain:8080" @@ -803,26 +803,26 @@ expressions -<Proxy balancer://hotcluster> - BalancerMember http://www2.example.com:8080 loadfactor=1 - BalancerMember http://www3.example.com:8080 loadfactor=2 +<Proxy "balancer://hotcluster"> + BalancerMember "http://www2.example.com:8080" loadfactor=1 + BalancerMember "http://www3.example.com:8080" loadfactor=2 ProxySet lbmethod=bytraffic </Proxy> -<Proxy http://backend> +<Proxy "http://backend"> ProxySet keepalive=On </Proxy> - ProxySet balancer://foo lbmethod=bytraffic timeout=15 + ProxySet "balancer://foo" lbmethod=bytraffic timeout=15 - ProxySet ajp://backend:7001 timeout=15 + ProxySet "ajp://backend:7001" timeout=15 Warning @@ -873,8 +873,8 @@ expressions then

    -<Location /mirror/foo/> - ProxyPass http://backend.example.com/ +<Location "/mirror/foo/"> + ProxyPass "http://backend.example.com/" </Location> @@ -888,7 +888,7 @@ expressions Balancer Manager interface:

    - ProxyPass /mirror/foo/ http://backend.example.com/ + ProxyPass "/mirror/foo/" "http://backend.example.com/" @@ -903,17 +903,17 @@ expressions to reverse-proxy a subdirectory, e.g.

    -<Location /mirror/foo/> - ProxyPass http://backend.example.com/ +<Location "/mirror/foo/"> + ProxyPass "http://backend.example.com/" </Location> -<Location /mirror/foo/i> - ProxyPass ! +<Location "/mirror/foo/i"> + ProxyPass "!" </Location> -ProxyPass /mirror/foo/i ! -ProxyPass /mirror/foo http://backend.example.com +ProxyPass "/mirror/foo/i" "!" +ProxyPass "/mirror/foo" "http://backend.example.com"

    will proxy all requests to /mirror/foo to @@ -962,7 +962,7 @@ ProxyPass /mirror/foo http://backend.example.com Example - ProxyPass /example http://backend.example.com max=20 ttl=120 retry=300 + ProxyPass "/example" "http://backend.example.com" max=20 ttl=120 retry=300 @@ -1250,25 +1250,25 @@ ProxyPass /mirror/foo http://backend.example.com

  • Description:Contains directives that apply to regular-expression matched filenames
    Syntax:<FilesMatch regex> ... </FilesMatch>
    Syntax:<FilesMatch "regex"> ... </FilesMatch>
    Context:server config, virtual host, directory, .htaccess
    Override:All
    Status:Core
    Description:Applies the enclosed directives only to matching URLs
    Syntax:<Location - URL-path|URL> ... </Location>
    Context:server config, virtual host
    Status:Core
    Module:core
    Description:Applies the enclosed directives only to regular-expression matching URLs
    Syntax:<LocationMatch - regex> ... </LocationMatch>
    Context:server config, virtual host
    Status:Core
    Module:core

    A sample balancer setup

    -ProxyPass /special-area http://special.example.com smax=5 max=10 -ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On -<Proxy balancer://mycluster> - BalancerMember ajp://1.2.3.4:8009 - BalancerMember ajp://1.2.3.5:8009 loadfactor=20 +ProxyPass "/special-area" "http://special.example.com" smax=5 max=10 +ProxyPass "/" "balancer://mycluster/" stickysession=JSESSIONID|jsessionid nofailover=On +<Proxy "balancer://mycluster"> + BalancerMember "ajp://1.2.3.4:8009" + BalancerMember "ajp://1.2.3.5:8009" loadfactor=20 # Less powerful server, don't send as many requests there, - BalancerMember ajp://1.2.3.6:8009 loadfactor=5 + BalancerMember "ajp://1.2.3.6:8009" loadfactor=5 </Proxy>

    Setting up a hot-standby, that will only be used if no other members are available

    -ProxyPass / balancer://hotcluster/ -<Proxy balancer://hotcluster> - BalancerMember ajp://1.2.3.4:8009 loadfactor=1 - BalancerMember ajp://1.2.3.5:8009 loadfactor=2 +ProxyPass "/" "balancer://hotcluster/" +<Proxy "balancer://hotcluster"> + BalancerMember "ajp://1.2.3.4:8009" loadfactor=1 + BalancerMember "ajp://1.2.3.5:8009" loadfactor=2 # The server below is on hot standby - BalancerMember ajp://1.2.3.6:8009 status=+H + BalancerMember "ajp://1.2.3.6:8009" status=+H ProxySet lbmethod=bytraffic </Proxy> @@ -1316,14 +1316,14 @@ ProxyPass / balancer://hotcluster/ RewriteEngine On -RewriteCond %{HTTPS} =off -RewriteRule . - [E=protocol:http] -RewriteCond %{HTTPS} =on -RewriteRule . - [E=protocol:https] +RewriteCond "%{HTTPS}" =off +RewriteRule "." "-" [E=protocol:http] +RewriteCond "%{HTTPS}" =on +RewriteRule "." "-" [E=protocol:https] -RewriteRule ^/mirror/foo/(.*) %{ENV:protocol}://backend.example.com/$1 [P] -ProxyPassReverse /mirror/foo/ http://backend.example.com/ -ProxyPassReverse /mirror/foo/ https://backend.example.com/ +RewriteRule "^/mirror/foo/(.*)" "%{ENV:protocol}://backend.example.com/$1" [P] +ProxyPassReverse "/mirror/foo/" "http://backend.example.com/" +ProxyPassReverse "/mirror/foo/" "https://backend.example.com/" @@ -1351,7 +1351,7 @@ ProxyPassReverse /mirror/foo/ https://backend.example.com/ then

    - ProxyPassMatch ^/(.*\.gif)$ http://backend.example.com/$1 + ProxyPassMatch "^/(.*\.gif)$" "http://backend.example.com/$1"

    will cause a local request for @@ -1362,13 +1362,13 @@ ProxyPassReverse /mirror/foo/ https://backend.example.com/ substitutions (as well as after). This limits the matches you can use. For instance, if we had used

    - ProxyPassMatch ^(/.*\.gif)$ http://backend.example.com:8000$1 + ProxyPassMatch "^(/.*\.gif)$" "http://backend.example.com:8000$1"

    in our previous example, it would fail with a syntax error at server startup. This is a bug (PR 46665 in the ASF bugzilla), and the workaround is to reformulate the match:

    - ProxyPassMatch ^/(.*\.gif)$ http://backend.example.com:8000/$1 + ProxyPassMatch "^/(.*\.gif)$" "http://backend.example.com:8000/$1"

    The ! directive is useful in situations where you don't want @@ -1435,10 +1435,10 @@ proxied server http://example.com/; then

    -ProxyPass /mirror/foo/ http://backend.example.com/ -ProxyPassReverse /mirror/foo/ http://backend.example.com/ -ProxyPassReverseCookieDomain backend.example.com public.example.com -ProxyPassReverseCookiePath / /mirror/foo/ +ProxyPass "/mirror/foo/" "http://backend.example.com/" +ProxyPassReverse "/mirror/foo/" "http://backend.example.com/" +ProxyPassReverseCookieDomain "backend.example.com" "public.example.com" +ProxyPassReverseCookiePath "/" "/mirror/foo/"

    will not only cause a local request for the @@ -1522,7 +1522,7 @@ In the example given with ProxyPassReverse, the directive:

    - ProxyPassReverseCookiePath / /mirror/foo/ + ProxyPassReverseCookiePath "/" "/mirror/foo/"

    will rewrite a cookie with backend path / (or @@ -1551,7 +1551,7 @@ proxied Example - ProxyBlock news.example.com auctions.example.com friends.example.com + ProxyBlock "news.example.com" "auctions.example.com" "friends.example.com" @@ -1563,7 +1563,7 @@ proxied

    Note also that

    - ProxyBlock * + ProxyBlock "*"

    blocks connections to all sites.

    @@ -1673,8 +1673,8 @@ directly Example -ProxyRemote * http://firewall.example.com:81 -NoProxy .example.com 192.168.112.0/21 +ProxyRemote "*" "http://firewall.example.com:81" +NoProxy ".example.com" "192.168.112.0/21" @@ -1814,9 +1814,9 @@ NoProxy .example.com 192.168.112.0/21 Example - ProxyRemote * http://firewall.example.com:81
    - NoProxy .example.com 192.168.112.0/21
    - ProxyDomain .example.com + ProxyRemote "*" "http://firewall.example.com:81"
    + NoProxy ".example.com" "192.168.112.0/21"
    + ProxyDomain ".example.com"
    diff --git a/docs/manual/mod/mod_proxy_ajp.xml b/docs/manual/mod/mod_proxy_ajp.xml index 63c3707f82..9cd0e7060d 100644 --- a/docs/manual/mod/mod_proxy_ajp.xml +++ b/docs/manual/mod/mod_proxy_ajp.xml @@ -58,19 +58,19 @@ Simple Reverse Proxy - ProxyPass /app ajp://backend.example.com:8009/app + ProxyPass "/app" "ajp://backend.example.com:8009/app"

    Balancers may also be used:

    Balancer Reverse Proxy -<Proxy balancer://cluster> - BalancerMember ajp://app1.example.com:8009 loadfactor=1 - BalancerMember ajp://app2.example.com:8009 loadfactor=2 +<Proxy "balancer://cluster"> + BalancerMember "ajp://app1.example.com:8009" loadfactor=1 + BalancerMember "ajp://app2.example.com:8009" loadfactor=2 ProxySet lbmethod=bytraffic </Proxy> -ProxyPass /app balancer://cluster/app +ProxyPass "/app" "balancer://cluster/app" @@ -88,8 +88,8 @@ ProxyPass /app balancer://cluster/app example:

    Rewriting Proxied Path -ProxyPass /apps/foo ajp://backend.example.com:8009/foo -ProxyPassReverse /apps/foo http://www.example.com/foo +ProxyPass "/apps/foo" "ajp://backend.example.com:8009/foo" +ProxyPassReverse "/apps/foo" "http://www.example.com/foo"

    However, it is usually better to deploy the application on the backend diff --git a/docs/manual/mod/mod_proxy_balancer.xml b/docs/manual/mod/mod_proxy_balancer.xml index fe03a92261..5e42c9ca8c 100644 --- a/docs/manual/mod/mod_proxy_balancer.xml +++ b/docs/manual/mod/mod_proxy_balancer.xml @@ -92,12 +92,12 @@

    -<Proxy balancer://mycluster> - BalancerMember http://192.168.1.50:80 - BalancerMember http://192.168.1.51:80 +<Proxy "balancer://mycluster"> + BalancerMember "http://192.168.1.50:80" + BalancerMember "http://192.168.1.51:80" </Proxy> -ProxyPass /test balancer://mycluster -ProxyPassReverse /test balancer://mycluster +ProxyPass "/test" "balancer://mycluster" +ProxyPassReverse "/test" "balancer://mycluster"

    Another example of how to provide load balancing with stickyness @@ -107,13 +107,13 @@ ProxyPassReverse /test balancer://mycluster Header add Set-Cookie "ROUTEID=.%{BALANCER_WORKER_ROUTE}e; path=/" env=BALANCER_ROUTE_CHANGED -<Proxy balancer://mycluster> - BalancerMember http://192.168.1.50:80 route=1 - BalancerMember http://192.168.1.51:80 route=2 +<Proxy "balancer://mycluster"> + BalancerMember "http://192.168.1.50:80" route=1 + BalancerMember "http://192.168.1.51:80" route=2 ProxySet stickysession=ROUTEID </Proxy> -ProxyPass /test balancer://mycluster -ProxyPassReverse /test balancer://mycluster +ProxyPass "/test" "balancer://mycluster" +ProxyPassReverse "/test" "balancer://mycluster"

    @@ -188,7 +188,7 @@ ProxyPassReverse /test balancer://mycluster domain add this code to your httpd.conf configuration file

    -<Location /balancer-manager> +<Location "/balancer-manager"> SetHandler balancer-manager Require host example.com </Location> @@ -249,10 +249,10 @@ ProxyPassReverse /test balancer://mycluster configuring the name of the cookie and the name of the URL parameter separated by a vertical bar (|) as in the following example:

    -ProxyPass /test balancer://mycluster stickysession=JSESSIONID|jsessionid scolonpathdelim=On -<Proxy balancer://mycluster> - BalancerMember http://192.168.1.50:80 route=node1 - BalancerMember http://192.168.1.51:80 route=node2 +ProxyPass "/test" "balancer://mycluster" stickysession=JSESSIONID|jsessionid scolonpathdelim=On +<Proxy "balancer://mycluster"> + BalancerMember "http://192.168.1.50:80" route=node1 + BalancerMember "http://192.168.1.51:80" route=node2 </Proxy>

    If the cookie and the request parameter both provide routing information diff --git a/docs/manual/mod/mod_proxy_express.xml b/docs/manual/mod/mod_proxy_express.xml index 2d8d44086d..9b8c3e27ca 100644 --- a/docs/manual/mod/mod_proxy_express.xml +++ b/docs/manual/mod/mod_proxy_express.xml @@ -64,8 +64,8 @@ <VirtualHost *:80> ServerName front.end.server - ProxyPass / back.end.server:port - ProxyPassReverse / back.end.server:port + ProxyPass "/" "back.end.server:port" + ProxyPassReverse "/" "back.end.server:port" </VirtualHost> That is, the entire URL is appended to the mapped backend diff --git a/docs/manual/mod/mod_proxy_fcgi.xml b/docs/manual/mod/mod_proxy_fcgi.xml index fa0699efa2..cb638acfa5 100644 --- a/docs/manual/mod/mod_proxy_fcgi.xml +++ b/docs/manual/mod/mod_proxy_fcgi.xml @@ -65,7 +65,7 @@ Single application instance - ProxyPass /myapp/ fcgi://localhost:4000/ + ProxyPass "/myapp/" "fcgi://localhost:4000/" @@ -78,7 +78,7 @@ Single application instance, connection reuse (2.4.11 and later) - ProxyPass /myapp/ fcgi://localhost:4000/ enablereuse=on + ProxyPass "/myapp/" "fcgi://localhost:4000/" enablereuse=on @@ -88,7 +88,7 @@ PHP-FPM is listening. Connection pooling is enabled.

    PHP-FPM - ProxyPassMatch ^/myapp/.*\.php(/.*)?$ fcgi://localhost:9000/var/www/ enablereuse=on + ProxyPassMatch "^/myapp/.*\.php(/.*)?$" "fcgi://localhost:9000/var/www/" enablereuse=on @@ -99,7 +99,7 @@ PHP-FPM with UDS # UDS does not currently support connection reuse - ProxyPassMatch ^/(.*\.php(/.*)?)$ "unix:/var/run/php5-fpm.sock|fcgi://localhost/var/www/" + ProxyPassMatch "^/(.*\.php(/.*)?)$" "unix:/var/run/php5-fpm.sock|fcgi://localhost/var/www/" @@ -111,10 +111,10 @@ Balanced gateway to multiple application instances -ProxyPass /myapp/ balancer://myappcluster/ -<Proxy balancer://myappcluster/> - BalancerMember fcgi://localhost:4000 - BalancerMember fcgi://localhost:4001 +ProxyPass "/myapp/" "balancer://myappcluster/" +<Proxy "balancer://myappcluster/"> + BalancerMember "fcgi://localhost:4000" + BalancerMember "fcgi://localhost:4001" </Proxy> @@ -133,7 +133,7 @@ ProxyPass /myapp/ balancer://myappcluster/

    Proxy via Handler -<FilesMatch \.php$> +<FilesMatch "\.php$"> # Note: The only part that varies is /path/to/app.sock SetHandler "proxy:unix:/path/to/app.sock|fcgi://localhost/" </FilesMatch> @@ -141,7 +141,7 @@ ProxyPass /myapp/ balancer://myappcluster/ # The part that is matched to the SetHandler is the part that # follows the pipe. If you need to distinguish, "localhost; can # be anything unique. - <Proxy fcgi://localhost/ enablereuse=on max=10> + <Proxy "fcgi://localhost/" enablereuse=on max=10> </Proxy> <FilesMatch ...> diff --git a/docs/manual/mod/mod_proxy_scgi.xml b/docs/manual/mod/mod_proxy_scgi.xml index 218e02cd30..a5ebc7e7c7 100644 --- a/docs/manual/mod/mod_proxy_scgi.xml +++ b/docs/manual/mod/mod_proxy_scgi.xml @@ -68,10 +68,10 @@ Balanced gateway -ProxyPass /scgi-bin/ balancer://somecluster/ -<Proxy balancer://somecluster> - BalancerMember scgi://localhost:4000 - BalancerMember scgi://localhost:4001 +ProxyPass "/scgi-bin/" "balancer://somecluster/" +<Proxy "balancer://somecluster"> + BalancerMember "scgi://localhost:4000" + BalancerMember "scgi://localhost:4001" </Proxy> diff --git a/docs/manual/mod/mod_proxy_wstunnel.xml b/docs/manual/mod/mod_proxy_wstunnel.xml index 4bef799633..588c531533 100644 --- a/docs/manual/mod/mod_proxy_wstunnel.xml +++ b/docs/manual/mod/mod_proxy_wstunnel.xml @@ -44,8 +44,8 @@ Connection: Upgrade Proxying requests to websockets server -ProxyPass /ws2/ ws://echo.websocket.org/ -ProxyPass /wss2/ wss://echo.websocket.org/ +ProxyPass "/ws2/" "ws://echo.websocket.org/" +ProxyPass "/wss2/" "wss://echo.websocket.org/" diff --git a/docs/manual/mod/mod_ratelimit.xml b/docs/manual/mod/mod_ratelimit.xml index e386dd581d..5cac06cbf8 100644 --- a/docs/manual/mod/mod_ratelimit.xml +++ b/docs/manual/mod/mod_ratelimit.xml @@ -39,7 +39,7 @@ variable rate-limit.

    Example Configuration -<Location /downloads> +<Location "/downloads"> SetOutputFilter RATE_LIMIT SetEnv rate-limit 400 </Location> diff --git a/docs/manual/mod/mod_reflector.xml b/docs/manual/mod/mod_reflector.xml index 17e5d2c813..06e4496783 100644 --- a/docs/manual/mod/mod_reflector.xml +++ b/docs/manual/mod/mod_reflector.xml @@ -44,7 +44,7 @@ body. This request requires a Content-Encoding request header containing "gzip" for the filter to return compressed data. -<Location /compress> +<Location "/compress"> SetHandler reflector SetOutputFilter DEFLATE </Location> @@ -55,7 +55,7 @@
    Pass the request body through an image downsampling filter, and reflect the results to the caller. -<Location /downsample> +<Location "/downsample"> SetHandler reflector SetOutputFilter DOWNSAMPLE </Location> diff --git a/docs/manual/mod/mod_rewrite.xml b/docs/manual/mod/mod_rewrite.xml index 75f35a43db..185a82c53e 100644 --- a/docs/manual/mod/mod_rewrite.xml +++ b/docs/manual/mod/mod_rewrite.xml @@ -321,14 +321,14 @@ later RewriteMap as:

    - RewriteMap examplemap txt:/path/to/file/map.txt + RewriteMap "examplemap" "txt:/path/to/file/map.txt"

    You would then be able to use this map in a RewriteRule as follows:

    - RewriteRule ^/ex/(.*) ${examplemap:$1} + RewriteRule "^/ex/(.*)" "${examplemap:$1}"

    The following combinations for MapType and @@ -407,12 +407,12 @@ later misconfiguration would normally cause the server to look for an "opt" directory under the document root.

    -DocumentRoot /var/www/example.com -AliasMatch ^/myapp /opt/myapp-1.2.3 -<Directory /opt/myapp-1.2.3> +DocumentRoot "/var/www/example.com" +AliasMatch "^/myapp" "/opt/myapp-1.2.3" +<Directory "/opt/myapp-1.2.3"> RewriteEngine On RewriteBase /myapp/ - RewriteRule ^index\.html$ welcome.html + RewriteRule "^index\.html$" "welcome.html" </Directory> @@ -920,7 +920,7 @@ AliasMatch ^/myapp /opt/myapp-1.2.3 RewriteCond expr "! %{HTTP_REFERER} -strmatch '*://%{HTTP_HOST}/*'"
    - RewriteRule ^/images - [F] + RewriteRule "^/images" "-" [F]
    @@ -948,9 +948,9 @@ AliasMatch ^/myapp /opt/myapp-1.2.3 instead of the implicit AND. Typical example: -RewriteCond %{REMOTE_HOST} ^host1 [OR] -RewriteCond %{REMOTE_HOST} ^host2 [OR] -RewriteCond %{REMOTE_HOST} ^host3 +RewriteCond "%{REMOTE_HOST}" "^host1" [OR] +RewriteCond "%{REMOTE_HOST}" "^host2" [OR] +RewriteCond "%{REMOTE_HOST}" "^host3" RewriteRule ...some special stuff for any of these hosts... @@ -978,10 +978,10 @@ RewriteRule ...some special stuff for any of these hosts... use the following:

    -RewriteCond %{HTTP_USER_AGENT} (iPhone|Blackberry|Android) -RewriteRule ^/$ /homepage.mobile.html [L] +RewriteCond "%{HTTP_USER_AGENT}" "(iPhone|Blackberry|Android)" +RewriteRule "^/$" "/homepage.mobile.html" [L] -RewriteRule ^/$ /homepage.std.html [L] +RewriteRule "^/$" "/homepage.std.html" [L]

    Explanation: If you use a browser which identifies itself diff --git a/docs/manual/mod/mod_session.xml b/docs/manual/mod/mod_session.xml index 963c0f0ccb..dc48a96b75 100644 --- a/docs/manual/mod/mod_session.xml +++ b/docs/manual/mod/mod_session.xml @@ -261,7 +261,7 @@ Session On SessionCryptoPassphrase secret SessionCookieName session path=/ AuthFormProvider file -AuthUserFile conf/passwd +AuthUserFile "conf/passwd" AuthType form AuthName realm #... diff --git a/docs/manual/mod/mod_speling.xml b/docs/manual/mod/mod_speling.xml index 4219c2f66c..959b522684 100644 --- a/docs/manual/mod/mod_speling.xml +++ b/docs/manual/mod/mod_speling.xml @@ -97,7 +97,7 @@ module directory names.

  • spelling corrections apply strictly to existing files, so - a request for the <Location /status> may + a request for the <Location "/status"> may get incorrectly treated as the negotiated file "/stats.html".
  • diff --git a/docs/manual/mod/mod_ssl.xml b/docs/manual/mod/mod_ssl.xml index e697645b93..780429bc75 100644 --- a/docs/manual/mod/mod_ssl.xml +++ b/docs/manual/mod/mod_ssl.xml @@ -174,7 +174,7 @@ provided. Information about this function is provided in the Compatibility chapter.

    Example -CustomLog logs/ssl_request_log "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" +CustomLog "logs/ssl_request_log" "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" @@ -322,7 +322,7 @@ query can be done in two ways which can be configured by Example -SSLPassPhraseDialog exec:/usr/local/apache/sbin/pp-filter +SSLPassPhraseDialog "exec:/usr/local/apache/sbin/pp-filter" @@ -405,12 +405,12 @@ The following source variants are available:

    Example SSLRandomSeed startup builtin -SSLRandomSeed startup file:/dev/random -SSLRandomSeed startup file:/dev/urandom 1024 -SSLRandomSeed startup exec:/usr/local/bin/truerand 16 +SSLRandomSeed startup "file:/dev/random" +SSLRandomSeed startup "file:/dev/urandom" 1024 +SSLRandomSeed startup "exec:/usr/local/bin/truerand" 16 SSLRandomSeed connect builtin -SSLRandomSeed connect file:/dev/random -SSLRandomSeed connect file:/dev/urandom 1024 +SSLRandomSeed connect "file:/dev/random" +SSLRandomSeed connect "file:/dev/urandom" 1024 @@ -483,8 +483,8 @@ The following five storage types are currently supported:

    Examples -SSLSessionCache dbm:/usr/local/apache/logs/ssl_gcache_data -SSLSessionCache shmcb:/usr/local/apache/logs/ssl_gcache_data(512000) +SSLSessionCache "dbm:/usr/local/apache/logs/ssl_gcache_data" +SSLSessionCache "shmcb:/usr/local/apache/logs/ssl_gcache_data(512000)" @@ -866,7 +866,7 @@ such issues. Example -SSLCertificateFile /usr/local/apache2/conf/ssl.crt/server.crt +SSLCertificateFile "/usr/local/apache2/conf/ssl.crt/server.crt" @@ -896,7 +896,7 @@ directive.

    Example -SSLCertificateKeyFile /usr/local/apache2/conf/ssl.key/server.key +SSLCertificateKeyFile "/usr/local/apache2/conf/ssl.key/server.key" @@ -944,7 +944,7 @@ certificates use the same certificate chain. Else the browsers will be confused in this situation.

    Example -SSLCertificateChainFile /usr/local/apache2/conf/ssl.crt/ca.crt +SSLCertificateChainFile "/usr/local/apache2/conf/ssl.crt/ca.crt" @@ -971,7 +971,7 @@ there: you also have to create symbolic links named contains the appropriate symbolic links.

    Example -SSLCACertificatePath /usr/local/apache2/conf/ssl.crt/ +SSLCACertificatePath "/usr/local/apache2/conf/ssl.crt/" @@ -995,7 +995,7 @@ preference. This can be used alternatively and/or additionally to SSLCACertificatePath.

    Example -SSLCACertificateFile /usr/local/apache2/conf/ssl.crt/ca-bundle-client.crt +SSLCACertificateFile "/usr/local/apache2/conf/ssl.crt/ca-bundle-client.crt" @@ -1042,7 +1042,7 @@ PEM-encoded CA certificates.

    Example -SSLCADNRequestFile /usr/local/apache2/conf/ca-names.crt +SSLCADNRequestFile "/usr/local/apache2/conf/ca-names.crt" @@ -1071,7 +1071,7 @@ Certificate files there: you also have to create symbolic links named this directory contains the appropriate symbolic links.

    Example -SSLCADNRequestPath /usr/local/apache2/conf/ca-names.crt/ +SSLCADNRequestPath "/usr/local/apache2/conf/ca-names.crt/" @@ -1098,7 +1098,7 @@ Additionally you have to create symbolic links named contains the appropriate symbolic links.

    Example -SSLCARevocationPath /usr/local/apache2/conf/ssl.crl/ +SSLCARevocationPath "/usr/local/apache2/conf/ssl.crl/" @@ -1123,7 +1123,7 @@ used alternatively and/or additionally to SSLCARevocationPath.

    Example -SSLCARevocationFile /usr/local/apache2/conf/ssl.crl/ca-bundle-client.crl +SSLCARevocationFile "/usr/local/apache2/conf/ssl.crl/ca-bundle-client.crl" @@ -1668,7 +1668,7 @@ directory contains the appropriate symbolic links.

    Example -SSLProxyMachineCertificatePath /usr/local/apache2/conf/proxy.crt/ +SSLProxyMachineCertificatePath "/usr/local/apache2/conf/proxy.crt/" @@ -1697,7 +1697,7 @@ or additionally to SSLProxyMachineCertificatePath. Example -SSLProxyMachineCertificateFile /usr/local/apache2/conf/ssl.crt/proxy.pem +SSLProxyMachineCertificateFile "/usr/local/apache2/conf/ssl.crt/proxy.pem" @@ -1729,7 +1729,7 @@ SSLProxyCACertificateFile.

    Example -SSLProxyMachineCertificateChainFile /usr/local/apache2/conf/ssl.crt/proxyCA.pem +SSLProxyMachineCertificateChainFile "/usr/local/apache2/conf/ssl.crt/proxyCA.pem" @@ -1979,7 +1979,7 @@ there: you also have to create symbolic links named contains the appropriate symbolic links.

    Example -SSLProxyCACertificatePath /usr/local/apache2/conf/ssl.crt/ +SSLProxyCACertificatePath "/usr/local/apache2/conf/ssl.crt/" @@ -2003,7 +2003,7 @@ preference. This can be used alternatively and/or additionally to SSLProxyCACertificatePath.

    Example -SSLProxyCACertificateFile /usr/local/apache2/conf/ssl.crt/ca-bundle-remote-server.crt +SSLProxyCACertificateFile "/usr/local/apache2/conf/ssl.crt/ca-bundle-remote-server.crt" @@ -2030,7 +2030,7 @@ Additionally you have to create symbolic links named contains the appropriate symbolic links.

    Example -SSLProxyCARevocationPath /usr/local/apache2/conf/ssl.crl/ +SSLProxyCARevocationPath "/usr/local/apache2/conf/ssl.crl/" @@ -2055,7 +2055,7 @@ used alternatively and/or additionally to SSLProxyCARevocationPath.

    Example -SSLProxyCARevocationFile /usr/local/apache2/conf/ssl.crl/ca-bundle-remote-server.crl +SSLProxyCARevocationFile "/usr/local/apache2/conf/ssl.crl/ca-bundle-remote-server.crl" @@ -2201,7 +2201,7 @@ directives.

    SSLVerifyClient on SSLOCSPEnable on -SSLOCSPDefaultResponder http://responder.example.com:8888/responder +SSLOCSPDefaultResponder "http://responder.example.com:8888/responder" SSLOCSPOverrideResponder on @@ -2641,7 +2641,7 @@ may sometimes differ.

    SSLOpenSSLConfCmd Options -SessionTicket,ServerPreference SSLOpenSSLConfCmd ECDHParameters brainpoolP256r1 -SSLOpenSSLConfCmd ServerInfoFile /usr/local/apache2/conf/server-info.pem +SSLOpenSSLConfCmd ServerInfoFile "/usr/local/apache2/conf/server-info.pem" SSLOpenSSLConfCmd Protocol "-ALL, TLSv1.2" SSLOpenSSLConfCmd SignatureAlgorithms RSA+SHA384:ECDSA+SHA256 diff --git a/docs/manual/mod/mod_status.xml b/docs/manual/mod/mod_status.xml index 12e94927b1..fad50d078c 100644 --- a/docs/manual/mod/mod_status.xml +++ b/docs/manual/mod/mod_status.xml @@ -78,7 +78,7 @@ performance domain add this code to your httpd.conf configuration file

    -<Location /server-status> +<Location "/server-status"> SetHandler server-status Require host example.com </Location> diff --git a/docs/manual/mod/mod_substitute.xml b/docs/manual/mod/mod_substitute.xml index 3e04ea7b0f..3eb5ed8afe 100644 --- a/docs/manual/mod/mod_substitute.xml +++ b/docs/manual/mod/mod_substitute.xml @@ -72,9 +72,9 @@ Example -<Location /> +<Location "/"> AddOutputFilterByType SUBSTITUTE text/html - Substitute s/foo/bar/ni + Substitute "s/foo/bar/ni" </Location> @@ -84,7 +84,7 @@ Example of using an alternate delimiter -<Location /> +<Location "/"> AddOutputFilterByType SUBSTITUTE text/html Substitute "s|<BR */?>|<br />|i" </Location> @@ -95,7 +95,7 @@ when regular expressions are used, as illustrated in the following example:

    Example of using backreferences and captures -<Location /> +<Location "/"> AddOutputFilterByType SUBSTITUTE text/html # "foo=k,bar=k" -> "foo/bar=k" Substitute "s|foo=(\w+),bar=\1|foo/bar=$1" @@ -114,8 +114,8 @@ Rewriting URLs embedded in proxied content -ProxyPass /blog/ http://internal.blog.example.com -ProxyPassReverse /blog/ http://internal.blog.example.com/ +ProxyPass "/blog/" "http://internal.blog.example.com" +ProxyPassReverse "/blog/" "http://internal.blog.example.com/" Substitute "s|http://internal.blog.example.com/|http://www.example.com/blog/|i" @@ -152,10 +152,10 @@ Substitute "s|http://internal.blog.example.com/|http://www.example.com/blog/|i" Example -<Location /> +<Location "/"> AddOutputFilterByType SUBSTITUTE text/html SubstituteMaxLineLength 10m - Substitute s/foo/bar/ni + Substitute "s/foo/bar/ni" </Location> diff --git a/docs/manual/mod/mod_vhost_alias.xml b/docs/manual/mod/mod_vhost_alias.xml index 4b7eb17c22..d5d77edebf 100644 --- a/docs/manual/mod/mod_vhost_alias.xml +++ b/docs/manual/mod/mod_vhost_alias.xml @@ -45,8 +45,8 @@ hosting /usr/local/apache2/cgi-bin/script.pl in all cases:

    -ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/ -VirtualScriptAlias /never/found/%0/cgi-bin/ +ScriptAlias "/cgi-bin/" "/usr/local/apache2/cgi-bin/" +VirtualScriptAlias "/never/found/%0/cgi-bin/" @@ -128,7 +128,7 @@ VirtualScriptAlias /never/found/%0/cgi-bin/ UseCanonicalName Off -VirtualDocumentRoot /usr/local/apache/vhosts/%0 +VirtualDocumentRoot "/usr/local/apache/vhosts/%0"

    A request for @@ -144,7 +144,7 @@ VirtualDocumentRoot /usr/local/apache/vhosts/%0 UseCanonicalName Off -VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2 +VirtualDocumentRoot "/usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2"

    A request for @@ -156,7 +156,7 @@ VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2 end of the name, for example:

    - VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.-1/%2.-2/%2.-3/%2 + VirtualDocumentRoot "/usr/local/apache/vhosts/%3+/%2.-1/%2.-2/%2.-3/%2"

    The example request would come from @@ -165,7 +165,7 @@ VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2

    Alternatively you might use:

    - VirtualDocumentRoot /usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2.4+ + VirtualDocumentRoot "/usr/local/apache/vhosts/%3+/%2.1/%2.2/%2.3/%2.4+"

    The example request would come from @@ -195,8 +195,8 @@ or example.com will all point to /usr/local/apache/vhosts/exa UseCanonicalName DNS -VirtualDocumentRootIP /usr/local/apache/vhosts/%1/%2/%3/%4/docs -VirtualScriptAliasIP /usr/local/apache/vhosts/%1/%2/%3/%4/cgi-bin +VirtualDocumentRootIP "/usr/local/apache/vhosts/%1/%2/%3/%4/docs" +VirtualScriptAliasIP "/usr/local/apache/vhosts/%1/%2/%3/%4/cgi-bin"

    A request for @@ -215,7 +215,7 @@ VirtualScriptAliasIP /usr/local/apache/vhosts/%1/%2/%3/%4/cgi-bin the following way:

    - VirtualDocumentRoot /usr/local/apache/vhosts/%2.0.%3.0 + VirtualDocumentRoot "/usr/local/apache/vhosts/%2.0.%3.0"

    A request for diff --git a/docs/manual/platform/windows.xml b/docs/manual/platform/windows.xml index c99031ab13..c4c3ba08dc 100644 --- a/docs/manual/platform/windows.xml +++ b/docs/manual/platform/windows.xml @@ -138,8 +138,8 @@ RewriteEngine On RewriteMap lowercase int:tolower -RewriteCond %{REQUEST_URI} [A-Z] -RewriteRule (.*) ${lowercase:$1} [R,L] +RewriteCond "%{REQUEST_URI}" "[A-Z]" +RewriteRule "(.*)" "${lowercase:$1}" [R,L]

  • When running, Apache needs write access only to the logs @@ -585,10 +585,10 @@ RewriteRule (.*) ${lowercase:$1} [R,L]

    Mapped drive letters
    -
    e.g., Alias /images/ Z:/
    +
    e.g., Alias "/images/" "Z:/"
    UNC paths
    -
    e.g., Alias /images/ //imagehost/www/images/
    +
    e.g., Alias "/images/" "//imagehost/www/images/"

    Mapped drive letters allow the administrator to maintain the @@ -603,21 +603,21 @@ RewriteRule (.*) ${lowercase:$1} [R,L] Example DocumentRoot with UNC path - DocumentRoot //dochost/www/html/ + DocumentRoot "//dochost/www/html/" Example DocumentRoot with IP address in UNC path - DocumentRoot //192.168.1.50/docs/ + DocumentRoot "//192.168.1.50/docs/" Example Alias and corresponding Directory with UNC path -Alias /images/ //imagehost/www/images/ +Alias "/images/" "//imagehost/www/images/" -<Directory //imagehost/www/images/> +<Directory "//imagehost/www/images/"> #... <Directory> diff --git a/docs/manual/rewrite/access.xml b/docs/manual/rewrite/access.xml index fddc0aad6b..650ad5c9db 100644 --- a/docs/manual/rewrite/access.xml +++ b/docs/manual/rewrite/access.xml @@ -84,27 +84,27 @@ configuration. -RewriteCond %{HTTP_REFERER} !^$ -RewriteCond %{HTTP_REFERER} !www.example.com [NC] -RewriteRule \.(gif|jpg|png)$ - [F,NC] +RewriteCond "%{HTTP_REFERER}" "!^$" +RewriteCond "%{HTTP_REFERER}" "!www.example.com" [NC] +RewriteRule "\.(gif|jpg|png)$" "-" [F,NC]

    In this second example, instead of failing the request, we display an alternate image instead.

    -RewriteCond %{HTTP_REFERER} !^$ -RewriteCond %{HTTP_REFERER} !www.example.com [NC] -RewriteRule \.(gif|jpg|png)$ /images/go-away.png [R,NC] +RewriteCond "%{HTTP_REFERER}" "!^$" +RewriteCond "%{HTTP_REFERER}" "!www.example.com" [NC] +RewriteRule "\.(gif|jpg|png)$" "/images/go-away.png" [R,NC]

    In the third example, we redirect the request to an image on some other site.

    -RewriteCond %{HTTP_REFERER} !^$ -RewriteCond %{HTTP_REFERER} !www.example.com [NC] -RewriteRule \.(gif|jpg|png)$ http://other.example.com/image.gif [R,NC] +RewriteCond "%{HTTP_REFERER}" "!^$" +RewriteCond "%{HTTP_REFERER}" "!www.example.com" [NC] +RewriteRule "\.(gif|jpg|png)$" "http://other.example.com/image.gif" [R,NC]

    Of these techniques, the last two tend to be the most effective @@ -121,8 +121,8 @@ RewriteRule \.(gif|jpg|png)$ http://other.example.com/image.gif [R,NC] accomplished without the use of mod_rewrite:

    -SetEnvIf Referer example\.com localreferer -<FilesMatch \.(jpg|png|gif)$> +SetEnvIf Referer "example\.com" localreferer +<FilesMatch "\.(jpg|png|gif)$"> Require env localreferer </FilesMatch> @@ -169,9 +169,9 @@ SetEnvIf Referer example\.com localreferer particular source.

    -RewriteCond %{HTTP_USER_AGENT} ^NameOfBadRobot -RewriteCond %{REMOTE_ADDR} =123\.45\.67\.[8-9] -RewriteRule ^/secret/files/ - [F] +RewriteCond "%{HTTP_USER_AGENT}" "^NameOfBadRobot" +RewriteCond "%{REMOTE_ADDR}" "=123\.45\.67\.[8-9]" +RewriteRule "^/secret/files/" "-" [F]
  • @@ -183,8 +183,8 @@ RewriteRule ^/secret/files/ - [F] same end using alternate means, as illustrated here:

    -SetEnvIfNoCase User-Agent ^NameOfBadRobot goaway -<Location /secret/files> +SetEnvIfNoCase User-Agent "^NameOfBadRobot" goaway +<Location "/secret/files"> <RequireAll> Require all granted Require not env goaway @@ -222,10 +222,10 @@ SetEnvIfNoCase User-Agent ^NameOfBadRobot goaway
    RewriteEngine on -RewriteMap hosts-deny txt:/path/to/hosts.deny -RewriteCond ${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND} !=NOT-FOUND [OR] -RewriteCond ${hosts-deny:%{REMOTE_HOST}|NOT-FOUND} !=NOT-FOUND -RewriteRule ^ - [F] +RewriteMap hosts-deny "txt:/path/to/hosts.deny" +RewriteCond "${hosts-deny:%{REMOTE_ADDR}|NOT-FOUND}" "!=NOT-FOUND" [OR] +RewriteCond "${hosts-deny:%{REMOTE_HOST}|NOT-FOUND}" "!=NOT-FOUND" +RewriteRule "^" "-" [F] @@ -275,15 +275,15 @@ bsdti1.sdm.de -
    with a redirection target.

    -RewriteMap deflector txt:/path/to/deflector.map +RewriteMap deflector "txt:/path/to/deflector.map" -RewriteCond %{HTTP_REFERER} !="" -RewriteCond ${deflector:%{HTTP_REFERER}} =- -RewriteRule ^ %{HTTP_REFERER} [R,L] +RewriteCond "%{HTTP_REFERER}" !="" +RewriteCond "${deflector:%{HTTP_REFERER}}" "=-" +RewriteRule "^" "%{HTTP_REFERER}" [R,L] -RewriteCond %{HTTP_REFERER} !="" -RewriteCond ${deflector:%{HTTP_REFERER}|NOT-FOUND} !=NOT-FOUND -RewriteRule ^ ${deflector:%{HTTP_REFERER}} [R,L] +RewriteCond "%{HTTP_REFERER}" !="" +RewriteCond "${deflector:%{HTTP_REFERER}|NOT-FOUND}" "!=NOT-FOUND" +RewriteRule "^" "${deflector:%{HTTP_REFERER}}" [R,L]

    The map file lists redirection targets for each referer, or, if diff --git a/docs/manual/rewrite/advanced.xml b/docs/manual/rewrite/advanced.xml index f94421589c..382a9a18ad 100644 --- a/docs/manual/rewrite/advanced.xml +++ b/docs/manual/rewrite/advanced.xml @@ -94,8 +94,8 @@ http://physical_host_of_user1/u/user/anypath RewriteEngine on -RewriteMap users-to-hosts txt:/path/to/map.users-to-hosts -RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hosts:$1|server0}/u/$1/$2 +RewriteMap users-to-hosts "txt:/path/to/map.users-to-hosts" +RewriteRule "^/u/([^/]+)/?(.*)" "http://${users-to-hosts:$1|server0}/u/$1/$2"

    @@ -127,8 +127,8 @@ RewriteRule ^/u/([^/]+)/?(.*) http://${users-to-hosts:$1|server0}/u/$1/$2 # This example is valid in per-directory context only -RewriteCond %{REQUEST_URI} !-U -RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L] +RewriteCond "%{REQUEST_URI}" "!-U" +RewriteRule "^(.+)\.html$" "/regenerate_page.cgi" [PT,L]

    The -U operator determines whether the test string @@ -169,8 +169,8 @@ RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L] RewriteEngine on -RewriteMap lb rnd:/path/to/serverlist.txt -RewriteRule ^/(.*) http://${lb:servers}/$1 [P,L] +RewriteMap lb "rnd:/path/to/serverlist.txt" +RewriteRule "^/(.*)" "http://${lb:servers}/$1" [P,L]

    serverlist.txt will contain a list of the servers:

    @@ -221,7 +221,7 @@ featureful than anything you can cobble together using mod_rewrite.

    RewriteEngine on -RewriteRule ^/~(([a-z])[a-z0-9]+)(.*) /home/$2/$1/public_html$3 +RewriteRule "^/~(([a-z])[a-z0-9]+)(.*)" "/home/$2/$1/public_html$3" @@ -280,10 +280,10 @@ RewriteRule ^/~(([a-z])[a-z0-9]+)(.*) /home/$2 RewriteEngine on -RewriteCond %{TIME_HOUR}%{TIME_MIN} >0700 -RewriteCond %{TIME_HOUR}%{TIME_MIN} <1900 -RewriteRule ^foo\.html$ foo.day.html [L] -RewriteRule ^foo\.html$ foo.night.html +RewriteCond "%{TIME_HOUR}%{TIME_MIN}" ">0700" +RewriteCond "%{TIME_HOUR}%{TIME_MIN}" "<1900" +RewriteRule "^foo\.html$" "foo.day.html" [L] +RewriteRule "^foo\.html$" "foo.night.html"

    This provides the content of foo.day.html @@ -325,14 +325,14 @@ RewriteRule ^foo\.html$ foo.night.html RewriteEngine on -RewriteRule ^/horse/(.*) /pony/$1 [E=rewritten:1] +RewriteRule "^/horse/(.*)" "/pony/$1" [E=rewritten:1]

    Later in your ruleset you might check for this environment variable using a RewriteCond:

    -RewriteCond %{ENV:rewritten} =1 +RewriteCond "%{ENV:rewritten}" "=1"

    Note that environment variables do not survive an external diff --git a/docs/manual/rewrite/avoid.xml b/docs/manual/rewrite/avoid.xml index d71eb13849..3a1813410d 100644 --- a/docs/manual/rewrite/avoid.xml +++ b/docs/manual/rewrite/avoid.xml @@ -98,7 +98,7 @@ following:

    <VirtualHost *:80> ServerName www.example.com - Redirect / https://www.example.com/ + Redirect "/" "https://www.example.com/" </VirtualHost > <VirtualHost *:443> @@ -130,7 +130,7 @@ is possible to perform this mapping with mod_rewrite, and performance.

    Using Alias -Alias /cats /var/www/virtualhosts/felines/htdocs +Alias "/cats" "/var/www/virtualhosts/felines/htdocs"

    @@ -173,7 +173,7 @@ href="flags.html#flag_p">[P] flag to pass rewritten URIs through mod_proxy.

    -RewriteRule ^/?images(.*) http://imageserver.local/images$1 [P] +RewriteRule "^/?images(.*)" "http://imageserver.local/images$1" [P]

    However, in many cases, when there is no actual pattern matching @@ -182,7 +182,7 @@ module="mod_proxy">ProxyPass directive is a better choice. The example here could be rendered as:

    -ProxyPass /images/ http://imageserver.local/images/ +ProxyPass "/images/" "http://imageserver.local/images/"

    Note that whether you use ProxyPass, you'll still need to use the catch redirects issued from the back-end server:

    -ProxyPassReverse /images/ http://imageserver.local/images/ +ProxyPassReverse "/images/" "http://imageserver.local/images/"

    You may need to use RewriteRule instead when there are @@ -218,7 +218,7 @@ module="core" type="section">If directive, as shown here:

    <If "req('Host') != 'www.example.com'"> - Redirect / http://www.example.com/ + Redirect "/" "http://www.example.com/" </If> diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml index ef746841f9..8ecbd5f344 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -46,7 +46,9 @@ providing detailed explanations and examples.

    its behavior modified by one or more flags. Flags are included in square brackets at the end of the rule, and multiple flags are separated by commas.

    -RewriteRule pattern target [Flag1,Flag2,Flag3] + +RewriteRule pattern target [Flag1,Flag2,Flag3] +

    Each flag (with a few exceptions) has a short form, such as CO, as well as a longer form, such as cookie. @@ -75,7 +77,9 @@ so backreferences are unescaped at the time they are applied. Using the B flag, non-alphanumeric characters in backreferences will be escaped. For example, consider the rule:

    -RewriteRule ^search/(.*)$ /search.php?term=$1 + +RewriteRule "^search/(.*)$" "/search.php?term=$1" +

    Given a search term of 'x & y/z', a browser will encode it as 'x%20%26%20y%2Fz', making the request 'search/x%20%26%20y%2Fz'. Without the B @@ -163,7 +167,7 @@ browsers that support this feature. RewriteEngine On -RewriteRule ^/index\.html - [CO=frontdoor:yes:.example.com:1440:/] +RewriteRule "^/index\.html" "-" [CO=frontdoor:yes:.example.com:1440:/]

    In the example give, the rule doesn't rewrite the request. @@ -250,8 +254,8 @@ environment variable is used to exclude those requests from the access log.

    -RewriteRule \.(png|gif|jpg)$ - [E=image:1] -CustomLog logs/access_log combined env=!image +RewriteRule "\.(png|gif|jpg)$" "-" [E=image:1] +CustomLog "logs/access_log" combined env=!image

    Note that this same effect can be obtained using

    The following rule will forbid .exe files from being downloaded from your server.

    -RewriteRule \.exe - [F] + +RewriteRule "\.exe" "-" [F] +

    This example uses the "-" syntax for the rewrite target, which means that the requested URI is not modified. There's no reason to rewrite to @@ -296,7 +302,9 @@ longer available.

    As with the [F] flag, you will typically use the "-" syntax for the rewrite target when using the [G] flag:

    -RewriteRule oldproduct - [G,NC] + +RewriteRule "oldproduct" "-" [G,NC] +

    When using [G], an [L] is implied - that is, the response is returned immediately, and no further rules are evaluated.

    @@ -308,7 +316,9 @@ immediately, and no further rules are evaluated.

    handler. For example, one might use this to force all files without a file extension to be parsed by the php handler:

    -RewriteRule !\. - [H=application/x-httpd-php] + +RewriteRule "!\." "-" [H=application/x-httpd-php] +

    The regular expression above - !\. - will match any request @@ -321,7 +331,7 @@ For example, the following snippet used in per-server context allows if they are requested with the .phps extension:

    -RewriteRule ^(/source/.+\.php)s$ $1 [H=application/x-httpd-php-source] +RewriteRule "^(/source/.+\.php)s$" "$1" [H=application/x-httpd-php-source]

    The regular expression above - ^(/source/.+\.php)s$ - will @@ -374,9 +384,9 @@ is already for index.php, the RewriteRule will be skipped.

    -RewriteBase / -RewriteCond %{REQUEST_URI} !=/index.php -RewriteRule ^(.*) /index.php?req=$1 [L,PT] +RewriteBase "/" +RewriteCond "%{REQUEST_URI}" "!=/index.php" +RewriteRule "^(.*)" "/index.php?req=$1" [L,PT] @@ -392,7 +402,9 @@ certain string or letter repeatedly in a request. The example shown here will replace A with B everywhere in a request, and will continue doing so until there are no more As to be replaced.

    -RewriteRule (.*)A(.*) $1B$2 [N] + +RewriteRule "(.*)A(.*)" "$1B$2" [N] +

    You can think of this as a while loop: While this pattern still matches (i.e., while the URI still contains an A), perform this substitution (i.e., replace the @@ -403,9 +415,9 @@ protect against unintended looping. An alternative maximum number of iterations can be specified by adding to the N flag.

    # Be willing to replace 1 character in each pass of the loop -RewriteRule (.+)[><;]$ $1 [N=64000] +RewriteRule "(.+)[><;]$" "$1" [N=64000] # ... or, give up if after 10 loops -RewriteRule (.+)[><;]$ $1 [N=10] +RewriteRule "(.+)[><;]$" "$1" [N=10] @@ -421,7 +433,9 @@ to your dedicated image server. The match is case-insensitive, so that .jpg and .JPG files are both acceptable, for example.

    -RewriteRule (.*\.(jpg|gif|png))$ http://images.example.com$1 [P,NC] + +RewriteRule "(.*\.(jpg|gif|png))$" "http://images.example.com$1" [P,NC] +
    NE|noescape @@ -430,7 +444,9 @@ example.

    equivalent. Using the [NE] flag prevents that from happening.

    -RewriteRule ^/anchor/(.+) /bigpage.html#$1 [NE,R] + +RewriteRule "^/anchor/(.+)" "/bigpage.html#$1" [NE,R] +

    The above example will redirect /anchor/xyz to @@ -471,7 +487,9 @@ requests. example, if you wanted all image requests to be handled by a back-end image server, you might do something like the following:

    -RewriteRule /(.*)\.(jpg|gif|png)$ http://images.example.com/$1.$2 [P] + +RewriteRule "/(.*)\.(jpg|gif|png)$" "http://images.example.com/$1.$2" [P] +

    Use of the [P] flag implies [L] - that is, the request is immediately pushed through the proxy, and any following rules will not be @@ -534,8 +552,8 @@ use the [PT] flag to ensure that the

    -Alias /icons /usr/local/apache/icons -RewriteRule /pics/(.+)\.jpg$ /icons/$1.gif [PT] +Alias "/icons" "/usr/local/apache/icons" +RewriteRule "/pics/(.+)\.jpg$" "/icons/$1.gif" [PT]

    @@ -565,7 +583,9 @@ Using the [QSA] flag causes the query strings to be combined.

    Consider the following rule:

    -RewriteRule /pages/(.+) /page.php?page=$1 [QSA] + +RewriteRule "/pages/(.+)" "/page.php?page=$1" [QSA] +

    With the [QSA] flag, a request for /pages/123?one=two will be mapped to /page.php?page=123&one=two. Without the [QSA] @@ -642,13 +662,13 @@ requested URI doesn't correspond with an actual file.

    # Is the request for a non-existent file? -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond "%{REQUEST_FILENAME}" "!-f" +RewriteCond "%{REQUEST_FILENAME}" "!-d" # If so, skip these two RewriteRules -RewriteRule .? - [S=2] +RewriteRule ".?" "-" [S=2] -RewriteRule (.*\.gif) images.php?$1 -RewriteRule (.*\.html) docs.php?$1 +RewriteRule "(.*\.gif)" "images.php?$1" +RewriteRule "(.*\.html)" "docs.php?$1"

    This technique is useful because a skip=N, where N is the number of rules in the else-clause:

    # Does the file exist? -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d +RewriteCond "%{REQUEST_FILENAME}" "!-f" +RewriteCond "%{REQUEST_FILENAME}" "!-d" # Create an if-then-else construct by skipping 3 lines if we meant to go to the "else" stanza. -RewriteRule .? - [S=3] +RewriteRule ".?" "-" [S=3] # IF the file exists, then: - RewriteRule (.*\.gif) images.php?$1 - RewriteRule (.*\.html) docs.php?$1 + RewriteRule "(.*\.gif)" "images.php?$1" + RewriteRule "(.*\.html)" "docs.php?$1" # Skip past the "else" stanza. - RewriteRule .? - [S=1] + RewriteRule ".?" "-" [S=1] # ELSE... - RewriteRule (.*) 404.php?file=$1 + RewriteRule "(.*)" "404.php?file=$1" # END @@ -694,7 +714,7 @@ source code as plain text, if requested in a particular way:

    # Serve .pl files as plain text -RewriteRule \.pl$ - [T=text/plain] +RewriteRule "\.pl$" "-" [T=text/plain]

    Or, perhaps, if you have a camera that produces jpeg images without @@ -703,7 +723,7 @@ correct MIME type by virtue of their file names:

    # Files with 'IMG' in the name are jpg images. -RewriteRule IMG - [T=image/jpg] +RewriteRule "IMG" "-" [T=image/jpg]

    Please note that this is a trivial example, and could be better done diff --git a/docs/manual/rewrite/intro.xml b/docs/manual/rewrite/intro.xml index 798bd00e93..871e56e5da 100644 --- a/docs/manual/rewrite/intro.xml +++ b/docs/manual/rewrite/intro.xml @@ -206,7 +206,7 @@ value.

    A full filesystem path to a resource
    -RewriteRule ^/games /usr/local/games/web +RewriteRule "^/games" "/usr/local/games/web"

    This maps a request to an arbitrary location on your filesystem, much like the Alias directive.

    @@ -215,7 +215,7 @@ like the Alias directive.

    A web-path to a resource
    -RewriteRule ^/foo$ /bar +RewriteRule "^/foo$" "/bar"

    If DocumentRoot is set to /usr/local/apache2/htdocs, then this directive would @@ -226,7 +226,7 @@ path /usr/local/apache2/htdocs/bar.

    An absolute URL
    -RewriteRule ^/product/view$ http://site2.example.com/seeproduct.html [R] +RewriteRule "^/product/view$" "http://site2.example.com/seeproduct.html" [R]

    This tells the client to make a new request for the specified URL.

    @@ -236,7 +236,7 @@ RewriteRule ^/product/view$ http://site2.example.com/seeproduct.html [R] contain back-references to parts of the incoming URL-path matched by the Pattern. Consider the following:

    -RewriteRule ^/product/(.*)/view$ /var/web/productdb/$1 +RewriteRule "^/product/(.*)/view$" "/var/web/productdb/$1"

    The variable $1 will be replaced with whatever text was matched by the expression inside the parenthesis in @@ -260,7 +260,7 @@ matching behavior of a rule can be made case-insensitive by the application of the [NC] flag:

    -RewriteRule ^puppy.html smalldog.html [NC] +RewriteRule "^puppy.html" "smalldog.html" [NC]

    For more details on the available flags, their meanings, and @@ -288,8 +288,8 @@ argument is a list of flags that modify how the match is evaluated.

    For example, to send all requests from a particular IP range to a different server, you could use:

    -RewriteCond %{REMOTE_ADDR} ^10\.2\. -RewriteRule (.*) http://intranet.example.com$1 +RewriteCond "%{REMOTE_ADDR}" "^10\.2\." +RewriteRule "(.*)" "http://intranet.example.com$1"

    When more than @@ -300,9 +300,9 @@ applied. For example, to deny requests that contain the word "hack" in their query string, unless they also contain a cookie containing the word "go", you could use:

    -RewriteCond %{QUERY_STRING} hack -RewriteCond %{HTTP_COOKIE} !go -RewriteRule . - [F] +RewriteCond "%{QUERY_STRING}" "hack" +RewriteCond "%{HTTP_COOKIE}" "!go" +RewriteRule "." "-" [F]

    Notice that the exclamation mark specifies a negative match, so the rule is only applied if the cookie does not contain "go".

    @@ -314,8 +314,8 @@ variables %1, %2, etc. For example, this will direct the request to a different directory depending on the hostname used to access the site:

    -RewriteCond %{HTTP_HOST} (.*) -RewriteRule ^/(.*) /sites/%1/$1 +RewriteCond "%{HTTP_HOST}" "(.*)" +RewriteRule "^/(.*)" "/sites/%1/$1"

    If the request was for http://example.com/foo/bar, then %1 would contain example.com diff --git a/docs/manual/rewrite/proxy.xml b/docs/manual/rewrite/proxy.xml index 0a881f256c..72e0af9685 100644 --- a/docs/manual/rewrite/proxy.xml +++ b/docs/manual/rewrite/proxy.xml @@ -67,9 +67,9 @@ A number of recipes are provided that describe common scenarios.

    RewriteEngine on -RewriteBase /products/ -RewriteRule ^widget/(.*)$ http://product.example.com/widget/$1 [P] -ProxyPassReverse /products/widget/ http://product.example.com/widget/ +RewriteBase "/products/" +RewriteRule "^widget/(.*)$" "http://product.example.com/widget/$1" [P] +ProxyPassReverse "/products/widget/" "http://product.example.com/widget/"

    In the second example, we proxy the request only if we can't find @@ -78,10 +78,10 @@ ProxyPassReverse /products/widget/ http://product.example.com/widget/ has been migrated yet.

    -RewriteCond %{REQUEST_FILENAME} !-f -RewriteCond %{REQUEST_FILENAME} !-d -RewriteRule ^/(.*) http://old.example.com/$1 [P] -ProxyPassReverse / http://old.example.com/ +RewriteCond "%{REQUEST_FILENAME}" !-f +RewriteCond "%{REQUEST_FILENAME}" !-d +RewriteRule "^/(.*)" "http://old.example.com/$1" [P] +ProxyPassReverse "/" "http://old.example.com/" diff --git a/docs/manual/rewrite/remapping.xml b/docs/manual/rewrite/remapping.xml index 9ff7b29f7a..a5f9a574ff 100644 --- a/docs/manual/rewrite/remapping.xml +++ b/docs/manual/rewrite/remapping.xml @@ -73,7 +73,7 @@ configuration. RewriteEngine on -RewriteRule ^/foo\.html$ /bar.html [PT] +RewriteRule "^/foo\.html$" "/bar.html" [PT] @@ -104,7 +104,7 @@ RewriteRule ^/foo\.html$ /bar.html [PT] RewriteEngine on -RewriteRule ^/foo\.html$ bar.html [R] +RewriteRule "^/foo\.html$" "bar.html" [R] @@ -116,7 +116,9 @@ RewriteRule ^/foo\.html$ bar.html [ - Redirect /foo.html /bar.html + +Redirect "/foo.html" "/bar.html" + @@ -143,17 +145,20 @@ RewriteRule ^/foo\.html$ bar.html [ -#With mod_rewrite + +#With mod_rewrite RewriteEngine on -RewriteRule ^/docs/(.+) http://new.example.com/docs/$1 [R,L] +RewriteRule "^/docs/(.+)" "http://new.example.com/docs/$1" [R,L] -#With RedirectMatch -RedirectMatch ^/docs/(.*) http://new.example.com/docs/$1 + +#With RedirectMatch +RedirectMatch "^/docs/(.*)" "http://new.example.com/docs/$1" -#With Redirect -Redirect /docs/ http://new.example.com/docs/ + +#With Redirect +Redirect "/docs/" "http://new.example.com/docs/" @@ -186,8 +191,8 @@ Redirect /docs/ http://new.example.com/docs/ RewriteEngine on -RewriteBase /~quux/ -RewriteRule ^foo\.html$ foo.cgi   [H=cgi-script] +RewriteBase "/~quux/" +RewriteRule "^foo\.html$" "foo.cgi"   [H=cgi-script] @@ -219,13 +224,13 @@ RewriteRule ^foo\.html$ foo.cgi   [H=cgi-script] # backward compatibility ruleset for # rewriting document.html to document.php # when and only when document.php exists -<Directory /var/www/htdocs> +<Directory "/var/www/htdocs"> RewriteEngine on - RewriteBase /var/www/htdocs + RewriteBase "/var/www/htdocs" - RewriteCond $1.php -f - RewriteCond $1.html !-f - RewriteRule ^(.*).html$ $1.php + RewriteCond "$1.php" -f + RewriteCond "$1.html" !-f + RewriteRule "^(.*).html$" "$1.php" </Directory> @@ -280,7 +285,7 @@ hostname(s).

    ServerName undesired.example.com ServerAlias example.com notthis.example.com - Redirect / http://www.example.com/ + Redirect "/" "http://www.example.com/" </VirtualHost> <VirtualHost *:80> @@ -294,7 +299,7 @@ directive:

    <If "%{HTTP_HOST} != 'www.example.com'"> - Redirect / http://www.example.com/ + Redirect "/" "http://www.example.com/" </If> @@ -303,7 +308,7 @@ might do the following:

    <If "%{SERVER_PROTOCOL} != 'HTTPS'"> - Redirect /admin/ https://www.example.com/admin/ + Redirect "/admin/" "https://www.example.com/admin/" </If> @@ -313,17 +318,17 @@ you might use one of the recipes below.

    For sites running on a port other than 80:

    -RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] -RewriteCond %{HTTP_HOST} !^$ -RewriteCond %{SERVER_PORT} !^80$ -RewriteRule ^/?(.*) http://www.example.com:%{SERVER_PORT}/$1 [L,R,NE] +RewriteCond "%{HTTP_HOST}" "!^www\.example\.com" [NC] +RewriteCond "%{HTTP_HOST}" "!^$" +RewriteCond "%{SERVER_PORT}" "!^80$" +RewriteRule "^/?(.*) "http://www.example.com:%{SERVER_PORT}/$1" [L,R,NE]

    And for a site running on port 80

    -RewriteCond %{HTTP_HOST} !^www\.example\.com [NC] -RewriteCond %{HTTP_HOST} !^$ -RewriteRule ^/?(.*) http://www.example.com/$1 [L,R,NE] +RewriteCond "%{HTTP_HOST}" "!^www\.example\.com" [NC] +RewriteCond "%{HTTP_HOST}" "!^$" +RewriteRule "^/?(.*)" "http://www.example.com/$1" [L,R,NE]

    @@ -334,9 +339,9 @@ RewriteRule ^/?(.*) http://www.example.com/$1 [L,R,NE] recipe:

    -RewriteCond %{HTTP_HOST} !^www\. [NC] -RewriteCond %{HTTP_HOST} !^$ -RewriteRule ^/?(.*) http://www.%{HTTP_HOST}/$1 [L,R,NE] +RewriteCond "%{HTTP_HOST}" "!^www\." [NC] +RewriteCond "%{HTTP_HOST}" "!^$" +RewriteRule "^/?(.*)" "http://www.%{HTTP_HOST}/$1" [L,R,NE]

    These rulesets will work either in your main server configuration @@ -373,17 +378,17 @@ RewriteEngine on # first try to find it in dir1/... # ...and if found stop and be happy: -RewriteCond %{DOCUMENT_ROOT}/dir1/%{REQUEST_URI} -f -RewriteRule ^(.+) %{DOCUMENT_ROOT}/dir1/$1 [L] +RewriteCond "%{DOCUMENT_ROOT}/dir1/%{REQUEST_URI}" -f +RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/dir1/$1" [L] # second try to find it in dir2/... # ...and if found stop and be happy: -RewriteCond %{DOCUMENT_ROOT}/dir2/%{REQUEST_URI} -f -RewriteRule ^(.+) %{DOCUMENT_ROOT}/dir2/$1 [L] +RewriteCond "%{DOCUMENT_ROOT}/dir2/%{REQUEST_URI}" -f +RewriteRule "^(.+)" "%{DOCUMENT_ROOT}/dir2/$1" [L] # else go on for other Alias or ScriptAlias directives, # etc. -RewriteRule ^ - [PT] +RewriteRule "^" "-" [PT] @@ -415,9 +420,9 @@ RewriteRule ^ - [PT] HostnameLookups on RewriteEngine on -RewriteMap multiplex txt:/path/to/map.mirrors -RewriteCond %{REMOTE_HOST} ([a-z]+)$ [NC] -RewriteRule ^/(.*)$ ${multiplex:%1|http://www.example.com/}$1 [R,L] +RewriteMap multiplex "txt:/path/to/map.mirrors" +RewriteCond "%{REMOTE_HOST}" "([a-z]+)$" [NC] +RewriteRule "^/(.*)$" "${multiplex:%1|http://www.example.com/}$1" [R,L] @@ -473,14 +478,14 @@ com http://www.example.com/
    This is done with the following ruleset:

    -RewriteCond %{HTTP_USER_AGENT} ^Mozilla/3.* -RewriteRule ^foo\.html$ foo.NS.html [L] +RewriteCond "%{HTTP_USER_AGENT}" "^Mozilla/3.*" +RewriteRule "^foo\.html$" "foo.NS.html" [L] -RewriteCond %{HTTP_USER_AGENT} ^Lynx/ [OR] -RewriteCond %{HTTP_USER_AGENT} ^Mozilla/[12] -RewriteRule ^foo\.html$ foo.20.html [L] +RewriteCond "%{HTTP_USER_AGENT}" "^Lynx/" [OR] +RewriteCond "%{HTTP_USER_AGENT}" "^Mozilla/[12]" +RewriteRule "^foo\.html$" "foo.20.html" [L] -RewriteRule ^foo\.html$ foo.32.html [L] +RewriteRule "^foo\.html$" "foo.32.html" [L] @@ -512,7 +517,9 @@ RewriteRule ^foo\.html$ foo.32.html [L we replace /puppies and /canines by the canonical /dogs.

    -RewriteRule ^/(puppies|canines)/(.*) /dogs/$2 [R] + +RewriteRule "^/(puppies|canines)/(.*)" "/dogs/$2" [R] +
    Discussion:
    @@ -520,7 +527,9 @@ RewriteRule ^foo\.html$ foo.32.html [L This should really be accomplished with Redirect or RedirectMatch directives: - RedirectMatch ^/(puppies|canines)/(.*) /dogs/$2 + +RedirectMatch "^/(puppies|canines)/(.*)" "/dogs/$2" + @@ -551,13 +560,15 @@ using the following ruleset:

    RewriteEngine on -RewriteRule ^/$ /about/ [R] +RewriteRule "^/$" "/about/" [R]

    Note that this can also be handled using the RedirectMatch directive:

    -RedirectMatch ^/$ http://example.com/about/ + +RedirectMatch "^/$" "http://example.com/about/" +

    Note also that the example rewrites only the root URL. That is, it rewrites a request for http://example.com/, but not a @@ -587,8 +598,8 @@ that should go to an existing resource such as an image, or a css file. module="mod_dir">FallbackResource directive for this:

    -<Directory /var/www/my_blog> - FallbackResource index.php +<Directory "/var/www/my_blog"> + FallbackResource "index.php" </Directory> @@ -597,19 +608,21 @@ complicated than this, you can use a variation of the following rewrite set to accomplish the same thing:

    -<Directory /var/www/my_blog> - RewriteBase /my_blog +<Directory "/var/www/my_blog"> + RewriteBase "/my_blog" - RewriteCond /var/www/my_blog/%{REQUEST_FILENAME} !-f - RewriteCond /var/www/my_blog/%{REQUEST_FILENAME} !-d - RewriteRule ^ index.php [PT] + RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-f + RewriteCond "/var/www/my_blog/%{REQUEST_FILENAME}" !-d + RewriteRule "^" "index.php" [PT] </Directory>

    If, on the other hand, you wish to pass the requested URI as a query string argument to index.php, you can replace that RewriteRule with:

    -RewriteRule (.*) index.php?$1 [PT,QSA] + +RewriteRule "(.*)" "index.php?$1" [PT,QSA] +

    Note that these rulesets can be used in a .htaccess file, as well as in a <Directory> block.

    @@ -641,8 +654,8 @@ substitutions.

    # Remove mykey=??? -RewriteCond %{QUERY_STRING} (.*(?:^|&))mykey=([^&]*)&?(.*)&?$ -RewriteRule (.*) $1?%1%3 +RewriteCond "%{QUERY_STRING}" "(.*(?:^|&))mykey=([^&]*)&?(.*)&?$" +RewriteRule "(.*)" "$1?%1%3" @@ -651,8 +664,8 @@ RewriteRule (.*) $1?%1%3 # Copy from query string to PATH_INFO -RewriteCond %{QUERY_STRING} (.*(?:^|&))mykey=([^&]*)&?(.*)&?$ -RewriteRule (.*) $1/products/%2/? [PT] +RewriteCond "%{QUERY_STRING}" "(.*(?:^|&))mykey=([^&]*)&?(.*)&?$" +RewriteRule "(.*)" "$1/products/%2/?" [PT] @@ -660,9 +673,9 @@ RewriteRule (.*) $1/products/%2/? [PT] # Capture the value of mykey in the query string -RewriteCond %{QUERY_STRING} (.*(?:^|&))mykey=([^&]*)&?(.*)&?$ -RewriteCond %2 !=not-so-secret-value -RewriteRule (.*) - [F] +RewriteCond "%{QUERY_STRING}" "(.*(?:^|&))mykey=([^&]*)&?(.*)&?$" +RewriteCond "%2" !=not-so-secret-value +RewriteRule "(.*)" - [F] @@ -671,7 +684,7 @@ RewriteRule (.*) - [F] # The desired URL might be /products/kitchen-sink, and the script expects # /path?products=kitchen-sink. -RewriteRule ^/?path/([^/]+)/([^/]+) /path?$1=$2 [PT] +RewriteRule "^/?path/([^/]+)/([^/]+)" "/path?$1=$2" [PT] diff --git a/docs/manual/rewrite/rewritemap.xml b/docs/manual/rewrite/rewritemap.xml index 47e247f4d2..a8f664f41c 100644 --- a/docs/manual/rewrite/rewritemap.xml +++ b/docs/manual/rewrite/rewritemap.xml @@ -60,7 +60,9 @@ configuration.

    The syntax of the RewriteMap directive is as follows:

    -RewriteMap MapName MapType:MapSource + +RewriteMap MapName MapType:MapSource +

    The MapName is an arbitray name that you assign to the map, and which you will use in @@ -84,15 +86,21 @@ configuration.

    For example, you might define a RewriteMap as:

    - RewriteMap examplemap txt:/path/to/file/map.txt + +RewriteMap examplemap "txt:/path/to/file/map.txt" +

    You would then be able to use this map in a RewriteRule as follows:

    -RewriteRule ^/ex/(.*) ${examplemap:$1} + +RewriteRule "^/ex/(.*)" "${examplemap:$1}" +

    A default value can be specified in the event that nothing is found in the map:

    -RewriteRule ^/ex/(.*) ${examplemap:$1|/not_found.html} + +RewriteRule "^/ex/(.*)" "${examplemap:$1|/not_found.html}" + Per-directory and .htaccess context

    @@ -135,8 +143,8 @@ may be used, and give examples of each.

    recipe:

    Product to ID configuration

    -RewriteMap product2id txt:/etc/apache2/productmap.txt -RewriteRule ^/product/(.*) /prods.php?id=${product2id:$1|NOTFOUND} [PT] +RewriteMap product2id "txt:/etc/apache2/productmap.txt" +RewriteRule "^/product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT]

    We assume here that the prods.php script knows what @@ -167,7 +175,9 @@ telephone 328 scope. If you're planning to use this in a .htaccess file, you'll need to remove the leading slash from the rewrite pattern in order for it to match anything: - RewriteRule ^product/(.*) /prods.php?id=${product2id:$1|NOTFOUND} [PT] + +RewriteRule "^product/(.*)" "/prods.php?id=${product2id:$1|NOTFOUND}" [PT] + Cached lookups @@ -205,10 +215,10 @@ dynamic www5|www6

    Configuration directives

    -RewriteMap servers rnd:/path/to/file/map.txt +RewriteMap servers "rnd:/path/to/file/map.txt" -RewriteRule ^/(.*\.(png|gif|jpg)) http://${servers:static}/$1 [NC,P,L] -RewriteRule ^/(.*) http://${servers:dynamic}/$1 [P,L] +RewriteRule "^/(.*\.(png|gif|jpg))" "http://${servers:static}/$1" [NC,P,L] +RewriteRule "^/(.*)" "http://${servers:dynamic}/$1" [P,L]

    So, when an image is requested and the first of these rules is @@ -241,7 +251,7 @@ static www1|www1|www2|www3|www4

    You may optionally specify a particular dbm type:

    -RewriteMap examplemap dbm=sdbm:/etc/apache/mapfile.dbm +RewriteMap examplemap "dbm=sdbm:/etc/apache/mapfile.dbm"

    The type can be sdbm, gdbm, ndbm or db. @@ -262,7 +272,7 @@ $ httxt2dbm -i mapfile.txt -o mapfile.map RewriteMap directive:

    -RewriteMap mapname dbm:/etc/apache/mapfile.map +RewriteMap mapname "dbm:/etc/apache/mapfile.map" @@ -316,7 +326,7 @@ by many requests. RewriteMap lc int:tolower -RewriteRule (.*?[A-Z]+.*) ${lc:$1} [R] +RewriteRule "(.*?[A-Z]+.*)" "${lc:$1}" [R] @@ -361,8 +371,8 @@ RewriteRule (.*?[A-Z]+.*) ${lc:$1} [R]

    Rewrite configuration

    -RewriteMap d2u prg:/www/bin/dash2under.pl
    -RewriteRule - ${d2u:%{REQUEST_URI}} +RewriteMap d2u "prg:/www/bin/dash2under.pl"
    +RewriteRule "-" "${d2u:%{REQUEST_URI}}"

    dash2under.pl

    diff --git a/docs/manual/rewrite/tech.xml b/docs/manual/rewrite/tech.xml index 081ecc036e..180a65770e 100644 --- a/docs/manual/rewrite/tech.xml +++ b/docs/manual/rewrite/tech.xml @@ -112,17 +112,17 @@ and URL matching.

    VirtualHost section - RewriteRule ^/images/(.+)\.jpg /images/$1.gif + RewriteRule "^/images/(.+)\.jpg" "/images/$1.gif" .htaccess file in document root - RewriteRule ^images/(.+)\.jpg images/$1.gif + RewriteRule "^images/(.+)\.jpg" "images/$1.gif" .htaccess file in images directory - RewriteRule ^(.+)\.jpg $1.gif + RewriteRule "^(.+)\.jpg" "$1.gif" diff --git a/docs/manual/rewrite/vhosts.xml b/docs/manual/rewrite/vhosts.xml index afb2b9933c..e5ebb1f1c8 100644 --- a/docs/manual/rewrite/vhosts.xml +++ b/docs/manual/rewrite/vhosts.xml @@ -76,8 +76,8 @@ RewriteEngine on RewriteMap lowercase int:tolower -RewriteCond ${lowercase:%{HTTP_HOST}} ^www\.([^.]+)\.example\.com$ -RewriteRule ^(.*) /home/%1/www$1 +RewriteCond "${lowercase:%{HTTP_HOST}}" "^www\.([^.]+)\.example\.com$" +RewriteRule "^(.*)" "/home/%1/www$1"
    Discussion
    @@ -135,9 +135,9 @@ UseCanonicalName Off # splittable logs LogFormat "%{Host}i %h %l %u %t \"%r\" %s %b" vcommon -CustomLog logs/access_log vcommon +CustomLog "logs/access_log" vcommon -<Directory /www/hosts> +<Directory "/www/hosts"> # ExecCGI is needed here because we can't force # CGI execution in the way that ScriptAlias does Options FollowSymLinks ExecCGI @@ -149,16 +149,16 @@ RewriteEngine On RewriteMap lowercase int:tolower ## deal with normal documents first: -# allow Alias /icons/ to work - repeat for other aliases -RewriteCond %{REQUEST_URI} !^/icons/ +# allow Alias "/icons/" to work - repeat for other aliases +RewriteCond "%{REQUEST_URI}" "!^/icons/" # allow CGIs to work -RewriteCond %{REQUEST_URI} !^/cgi-bin/ +RewriteCond "%{REQUEST_URI}" "!^/cgi-bin/" # do the magic -RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1 +RewriteRule "^/(.*)$" "/www/hosts/${lowercase:%{SERVER_NAME}}/docs/$1" ## and now deal with CGIs - we have to force a handler -RewriteCond %{REQUEST_URI} ^/cgi-bin/ -RewriteRule ^/(.*)$ /www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1 [H=cgi-script] +RewriteCond "%{REQUEST_URI}" "^/cgi-bin/" +RewriteRule "^/(.*)$" "/www/hosts/${lowercase:%{SERVER_NAME}}/cgi-bin/$1" [H=cgi-script]
    @@ -188,20 +188,20 @@ RewriteEngine on RewriteMap lowercase int:tolower # define the map file -RewriteMap vhost txt:/www/conf/vhost.map +RewriteMap vhost "txt:/www/conf/vhost.map" # deal with aliases as above -RewriteCond %{REQUEST_URI} !^/icons/ -RewriteCond %{REQUEST_URI} !^/cgi-bin/ -RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$ +RewriteCond "%{REQUEST_URI}" "!^/icons/" +RewriteCond "%{REQUEST_URI}" "!^/cgi-bin/" +RewriteCond "${lowercase:%{SERVER_NAME}}" "^(.+)$" # this does the file-based remap -RewriteCond ${vhost:%1} ^(/.*)$ -RewriteRule ^/(.*)$ %1/docs/$1 +RewriteCond "${vhost:%1}" "^(/.*)$" +RewriteRule "^/(.*)$" "%1/docs/$1" -RewriteCond %{REQUEST_URI} ^/cgi-bin/ -RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$ -RewriteCond ${vhost:%1} ^(/.*)$ -RewriteRule ^/(.*)$ %1/cgi-bin/$1 [H=cgi-script] +RewriteCond "%{REQUEST_URI}" "^/cgi-bin/" +RewriteCond "${lowercase:%{SERVER_NAME}}" "^(.+)$" +RewriteCond "${vhost:%1}" "^(/.*)$" +RewriteRule "^/(.*)$" "%1/cgi-bin/$1" [H=cgi-script]
    diff --git a/docs/manual/sections.xml b/docs/manual/sections.xml index a2d0f27f73..acff9a7fe1 100644 --- a/docs/manual/sections.xml +++ b/docs/manual/sections.xml @@ -77,7 +77,7 @@ to another site only if the server is started using <IfDefine ClosedForNow> - Redirect / http://otherserver.example.com/ + Redirect "/" "http://otherserver.example.com/" </IfDefine> @@ -99,7 +99,7 @@ applied only if mod_mime_magic is available.

    <IfModule mod_mime_magic.c> - MimeMagicFile conf/magic + MimeMagicFile "conf/magic" </IfModule> @@ -161,7 +161,7 @@ following configuration, directory indexes will be enabled for the /var/web/dir1 directory and all subdirectories.

    -<Directory /var/web/dir1> +<Directory "/var/web/dir1"> Options +Indexes </Directory> @@ -175,7 +175,7 @@ deny access to any file named private.html regardless of where it is found.

    -<Files private.html> +<Files "private.html"> Require all denied </Files> @@ -191,8 +191,8 @@ of private.html found under the /var/web/dir1/ directory.

    -<Directory /var/web/dir1> - <Files private.html> +<Directory "/var/web/dir1"> + <Files "private.html"> Require all denied </Files> </Directory> @@ -213,7 +213,7 @@ In particular, it will apply to requests for as any other requests starting with the /private string.

    -<LocationMatch ^/private> +<LocationMatch "^/private"> Require all denied </LocationMatch> @@ -226,7 +226,7 @@ No file called server-status needs to exist in the filesystem.

    -<Location /server-status> +<Location "/server-status"> SetHandler server-status </Location> @@ -237,22 +237,22 @@ filesystem.

    certain sections or directives are evaluated. For Location this would be:

    -<Location /foo> +<Location "/foo"> </Location> -<Location /foo/bar> +<Location "/foo/bar"> </Location>

    Aliases on the other hand, are mapped vice-versa:

    -Alias /foo/bar /srv/www/uncommon/bar -Alias /foo /srv/www/common/foo +Alias "/foo/bar" "/srv/www/uncommon/bar" +Alias "/foo" "/srv/www/common/foo"

    The same is true for the ProxyPass directives:

    -ProxyPass /special-area http://special.example.com smax=5 max=10 -ProxyPass / balancer://mycluster/ stickysession=JSESSIONID|jsessionid nofailover=On +ProxyPass "/special-area" "http://special.example.com" smax=5 max=10 +ProxyPass "/" "balancer://mycluster/" stickysession=JSESSIONID|jsessionid nofailover=On @@ -283,7 +283,7 @@ how directives are applied.

    all user directories could look as follows:

    -<Directory /home/*/public_html> +<Directory "/home/*/public_html"> Options Indexes </Directory> @@ -291,7 +291,7 @@ all user directories could look as follows:

    Using regex sections, we can deny access to many types of image files at once:

    -<FilesMatch \.(?i:gif|jpe?g|png)$> +<FilesMatch "\.(?i:gif|jpe?g|png)$"> Require all denied </FilesMatch> @@ -303,8 +303,8 @@ and URLs to be referenced from within expressions and modules like mod_rewrite.

    -<DirectoryMatch ^/var/www/combined/(?<SITENAME>[^/]+)> - require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example +<DirectoryMatch "^/var/www/combined/(?<SITENAME>[^/]+)"> + require ldap-group "cn=%{env:MATCH_SITENAME},ou=combined,o=Example" </DirectoryMatch> @@ -343,7 +343,7 @@ location, allowing your restrictions to be circumvented. For example, consider the following configuration:

    -<Location /dir/> +<Location "/dir/"> Require all denied </Location> @@ -369,7 +369,7 @@ many other ways to map multiple webspace locations to the same filesystem location. Therefore you should always use the filesystem containers when you can. There is, however, one exception to this rule. Putting configuration restrictions in a <Location -/> section is perfectly safe because this section will apply +"/"> section is perfectly safe because this section will apply to all requests regardless of the specific URL.

    @@ -410,7 +410,7 @@ will prevent the proxy server from being used to access the www.example.com website.

    -<Proxy http://www.example.com/*> +<Proxy "http://www.example.com/*"> Require all granted </Proxy> @@ -467,7 +467,7 @@ are interpreted, it is important to understand how this works.

    Directory)
  • DirectoryMatch - (and <Directory ~>)
  • + (and <Directory "~">)
  • Files and the order that they appear in the configuration files. Directory (group 1 above) is processed in the order shortest directory component to longest. - So for example, <Directory /var/web/dir> will + So for example, <Directory "/var/web/dir"> will be processed before <Directory - /var/web/dir/subdir>. If multiple . If multiple Directory sections apply to the same directory they are processed in the configuration file order. Configurations included via the -<Location /> +<Location "/"> E </Location> -<Files f.html> +<Files "f.html"> D </Files> <VirtualHost *> -<Directory /a/b> +<Directory "/a/b"> B </Directory> </VirtualHost> @@ -553,7 +553,7 @@ E.

    C </DirectoryMatch> -<Directory /a/b> +<Directory "/a/b"> A </Directory> @@ -567,12 +567,12 @@ evaluated last and will allow unrestricted access to the server. In other words, order of merging is important, so be careful!

    -<Location /> +<Location "/"> Require all granted </Location> # Woops! This <Directory> section will have no effect -<Directory /> +<Directory "/"> <RequireAll> Require all granted Require not host badguy.example.com diff --git a/docs/manual/ssl/ssl_faq.xml b/docs/manual/ssl/ssl_faq.xml index 96376a0295..d144aa84d9 100644 --- a/docs/manual/ssl/ssl_faq.xml +++ b/docs/manual/ssl/ssl_faq.xml @@ -174,8 +174,8 @@ relative hyperlinks?
  • manipulate relative hyperlinks, to achieve the same effect.

    RewriteEngine on -RewriteRule ^/(.*)_SSL$ https://%{SERVER_NAME}/$1 [R,L] -RewriteRule ^/(.*)_NOSSL$ http://%{SERVER_NAME}/$1 [R,L] +RewriteRule "^/(.*)_SSL$" "https://%{SERVER_NAME}/$1" [R,L] +RewriteRule "^/(.*)_NOSSL$" "http://%{SERVER_NAME}/$1" [R,L]

    This rewrite ruleset lets you use hyperlinks of the form @@ -254,8 +254,8 @@ Certificate for testing purposes? These can be used as follows in your httpd.conf file: -SSLCertificateFile /path/to/this/server.crt -SSLCertificateKeyFile /path/to/this/server.key +SSLCertificateFile "/path/to/this/server.crt" +SSLCertificateKeyFile "/path/to/this/server.key"

  • It is important that you are aware that this @@ -334,8 +334,8 @@ SSLCertificateKeyFile /path/to/this/server.key server.crt. These can be used as follows in your httpd.conf file: -SSLCertificateFile /path/to/this/server.crt -SSLCertificateKeyFile /path/to/this/server.key +SSLCertificateFile "/path/to/this/server.crt" +SSLCertificateKeyFile "/path/to/this/server.key" The server.csr file is no longer needed.
  • diff --git a/docs/manual/ssl/ssl_howto.xml b/docs/manual/ssl/ssl_howto.xml index a7bc192c7f..d0fc1fe47d 100644 --- a/docs/manual/ssl/ssl_howto.xml +++ b/docs/manual/ssl/ssl_howto.xml @@ -46,8 +46,8 @@ Listen 443 <VirtualHost *:443> ServerName www.example.com SSLEngine on - SSLCertificateFile /path/to/www.example.com.cert - SSLCertificateKeyFile /path/to/www.example.com.key + SSLCertificateFile "/path/to/www.example.com.cert" + SSLCertificateKeyFile "/path/to/www.example.com.key" </VirtualHost>
    @@ -94,7 +94,7 @@ URL? # be liberal in general SSLCipherSuite ALL:!aNULL:RC4+RSA:+HIGH:+MEDIUM:+LOW:+EXP:+eNULL -<Location /strong/area> +<Location "/strong/area"> # but https://hostname/strong/area/ and below # requires strong ciphers SSLCipherSuite HIGH:!aNULL:!MD5 @@ -281,7 +281,7 @@ Intranet website, for clients coming from the Internet? # signed by our CA certificate in ca.crt SSLVerifyClient require SSLVerifyDepth 1 -SSLCACertificateFile conf/ssl.crt/ca.crt +SSLCACertificateFile "conf/ssl.crt/ca.crt"
    @@ -295,9 +295,9 @@ SSLCACertificateFile conf/ssl.crt/ca.crt SSLVerifyClient none -SSLCACertificateFile conf/ssl.crt/ca.crt +SSLCACertificateFile "conf/ssl.crt/ca.crt" -<Location /secure/area> +<Location "/secure/area"> SSLVerifyClient require SSLVerifyDepth 1 </Location> @@ -322,10 +322,10 @@ SSLVerifyDepth 1 SSLVerifyClient none -SSLCACertificateFile conf/ssl.crt/ca.crt -SSLCACertificatePath conf/ssl.crt +SSLCACertificateFile "conf/ssl.crt/ca.crt" +SSLCACertificatePath "conf/ssl.crt" -<Directory /usr/local/apache2/htdocs/secure/area> +<Directory "/usr/local/apache2/htdocs/secure/area"> SSLVerifyClient require SSLVerifyDepth 5 SSLOptions +FakeBasicAuth @@ -333,7 +333,7 @@ SSLCACertificatePath conf/ssl.crt AuthName "Snake Oil Authentication" AuthType Basic AuthBasicProvider file - AuthUserFile /usr/local/apache2/conf/httpd.passwd + AuthUserFile "/usr/local/apache2/conf/httpd.passwd" Require valid-user </Directory> @@ -355,10 +355,10 @@ SSLCACertificatePath conf/ssl.crt SSLVerifyClient none -SSLCACertificateFile conf/ssl.crt/ca.crt -SSLCACertificatePath conf/ssl.crt +SSLCACertificateFile "conf/ssl.crt/ca.crt" +SSLCACertificatePath "conf/ssl.crt" -<Directory /usr/local/apache2/htdocs/secure/area> +<Directory "/usr/local/apache2/htdocs/secure/area"> SSLVerifyClient require SSLVerifyDepth 5 SSLOptions +FakeBasicAuth @@ -382,14 +382,14 @@ plain HTTP access for clients on the Intranet. that it applies to both HTTPS and HTTP.

    -SSLCACertificateFile conf/ssl.crt/company-ca.crt +SSLCACertificateFile "conf/ssl.crt/company-ca.crt" -<Directory /usr/local/apache2/htdocs> +<Directory "/usr/local/apache2/htdocs"> # Outside the subarea only Intranet access is granted Require ip 192.168.1.0/24 </Directory> -<Directory /usr/local/apache2/htdocs/subarea> +<Directory "/usr/local/apache2/htdocs/subarea"> # Inside the subarea any Intranet access is allowed # but from the Internet only HTTPS + Strong-Cipher + Password # or the alternative HTTPS + Strong-Cipher + Client-Certificate @@ -403,9 +403,9 @@ SSLCACertificateFile conf/ssl.crt/company-ca.crt # Force clients from the Internet to use HTTPS RewriteEngine on - RewriteCond %{REMOTE_ADDR} !^192\.168\.1\.[0-9]+$ - RewriteCond %{HTTPS} !=on - RewriteRule . - [F] + RewriteCond "%{REMOTE_ADDR}" "!^192\.168\.1\.[0-9]+$" + RewriteCond "%{HTTPS}" "!=on" + RewriteRule "." "-" [F] # Allow Network Access and/or Basic Auth Satisfy any @@ -417,7 +417,7 @@ SSLCACertificateFile conf/ssl.crt/company-ca.crt AuthType basic AuthName "Protected Intranet Area" AuthBasicProvider file - AuthUserFile conf/protected.passwd + AuthUserFile "conf/protected.passwd" Require valid-user </Directory> diff --git a/docs/manual/urlmapping.xml b/docs/manual/urlmapping.xml index 5e22e38a5d..5273b050dc 100644 --- a/docs/manual/urlmapping.xml +++ b/docs/manual/urlmapping.xml @@ -139,7 +139,9 @@ module="mod_alias">Alias directive will map any part of the filesystem into the web space. For example, with

    -Alias /docs /var/web + +Alias "/docs" "/var/web" +

    the URL http://www.example.com/docs/dir/file.html will be served from /var/web/dir/file.html. The @@ -156,7 +158,7 @@ example,

    - ScriptAliasMatch ^/~([a-zA-Z0-9]+)/cgi-bin/(.+) /home/$1/cgi-bin/$2 + ScriptAliasMatch "^/~([a-zA-Z0-9]+)/cgi-bin/(.+)" "/home/$1/cgi-bin/$2"

    will map a request to @@ -204,7 +206,7 @@ AliasMatch directive:

    - AliasMatch ^/upages/([a-zA-Z0-9]+)(/(.*))?$ /home/$1/public_html/$3 + AliasMatch "^/upages/([a-zA-Z0-9]+)(/(.*))?$" "/home/$1/public_html/$3" @@ -224,7 +226,7 @@ to request the content at the new location as follows:

    - Redirect permanent /foo/ http://www.example.com/bar/ + Redirect permanent "/foo/" "http://www.example.com/bar/"

    This will redirect any URL-Path starting in @@ -240,14 +242,14 @@ requests alone, use the following configuration:

    - RedirectMatch permanent ^/$ http://www.example.com/startpage.html + RedirectMatch permanent "^/$" "http://www.example.com/startpage.html"

    Alternatively, to temporarily redirect all pages on one site to a particular page on another site, use the following:

    - RedirectMatch temp .* http://othersite.example.com/startpage.html + RedirectMatch temp ".*" "http://othersite.example.com/startpage.html" @@ -267,10 +269,10 @@ and returns them to the client as if they were from the local server.

    -ProxyPass /foo/ http://internal.example.com/bar/
    -ProxyPassReverse /foo/ http://internal.example.com/bar/
    +ProxyPass "/foo/" "http://internal.example.com/bar/"
    +ProxyPassReverse "/foo/" "http://internal.example.com/bar/"
    ProxyPassReverseCookieDomain internal.example.com public.example.com
    -ProxyPassReverseCookiePath /foo/ /bar/ +ProxyPassReverseCookiePath "/foo/" "/bar/"

    The ProxyPass configures @@ -291,7 +293,7 @@ content) in a page as it is being served to the client using mod_substitute.

    -Substitute s/internal\.example\.com/www.example.com/i +Substitute "s/internal\.example\.com/www.example.com/i"

    For more sophisticated rewriting of links in HTML and XHTML, the diff --git a/docs/manual/vhosts/examples.xml b/docs/manual/vhosts/examples.xml index f00b9454f0..44540348e6 100644 --- a/docs/manual/vhosts/examples.xml +++ b/docs/manual/vhosts/examples.xml @@ -57,14 +57,14 @@ # Ensure that Apache listens on port 80 Listen 80 <VirtualHost *:80> - DocumentRoot /www/example1 + DocumentRoot "/www/example1" ServerName www.example.com # Other directives here </VirtualHost> <VirtualHost *:80> - DocumentRoot /www/example2 + DocumentRoot "/www/example2" ServerName www.example.org # Other directives here @@ -121,17 +121,17 @@ Listen 80 # This is the "main" server running on 172.20.30.40 ServerName server.example.com -DocumentRoot /www/mainserver +DocumentRoot "/www/mainserver" <VirtualHost 172.20.30.50> - DocumentRoot /www/example1 + DocumentRoot "/www/example1" ServerName www.example.com # Other directives here ... </VirtualHost> <VirtualHost 172.20.30.50> - DocumentRoot /www/example2 + DocumentRoot "/www/example2" ServerName www.example.org # Other directives here ... @@ -163,7 +163,7 @@ DocumentRoot /www/mainserver <VirtualHost 192.168.1.1 172.20.30.40> - DocumentRoot /www/server1 + DocumentRoot "/www/server1" ServerName server.example.com ServerAlias server </VirtualHost> @@ -199,22 +199,22 @@ Listen 8080 <VirtualHost 172.20.30.40:80> ServerName www.example.com - DocumentRoot /www/domain-80 + DocumentRoot "/www/domain-80" </VirtualHost> <VirtualHost 172.20.30.40:8080> ServerName www.example.com - DocumentRoot /www/domain-8080 + DocumentRoot "/www/domain-8080" </VirtualHost> <VirtualHost 172.20.30.40:80> ServerName www.example.org - DocumentRoot /www/otherdomain-80 + DocumentRoot "/www/otherdomain-80" </VirtualHost> <VirtualHost 172.20.30.40:8080> ServerName www.example.org - DocumentRoot /www/otherdomain-8080 + DocumentRoot "/www/otherdomain-8080" </VirtualHost> @@ -231,12 +231,12 @@ Listen 8080 Listen 80 <VirtualHost 172.20.30.40> - DocumentRoot /www/example1 + DocumentRoot "/www/example1" ServerName www.example.com </VirtualHost> <VirtualHost 172.20.30.50> - DocumentRoot /www/example2 + DocumentRoot "/www/example2" ServerName www.example.org </VirtualHost> @@ -264,22 +264,22 @@ Listen 172.20.30.50:80 Listen 172.20.30.50:8080 <VirtualHost 172.20.30.40:80> - DocumentRoot /www/example1-80 + DocumentRoot "/www/example1-80" ServerName www.example.com </VirtualHost> <VirtualHost 172.20.30.40:8080> - DocumentRoot /www/example1-8080 + DocumentRoot "/www/example1-8080" ServerName www.example.com </VirtualHost> <VirtualHost 172.20.30.50:80> - DocumentRoot /www/example2-80 + DocumentRoot "/www/example2-80" ServerName www.example.org </VirtualHost> <VirtualHost 172.20.30.50:8080> - DocumentRoot /www/example2-8080 + DocumentRoot "/www/example2-8080" ServerName www.example.org </VirtualHost> @@ -295,28 +295,28 @@ Listen 172.20.30.50:8080 Listen 80 <VirtualHost 172.20.30.40> - DocumentRoot /www/example1 + DocumentRoot "/www/example1" ServerName www.example.com </VirtualHost> <VirtualHost 172.20.30.40> - DocumentRoot /www/example2 + DocumentRoot "/www/example2" ServerName www.example.org </VirtualHost> <VirtualHost 172.20.30.40> - DocumentRoot /www/example3 + DocumentRoot "/www/example3" ServerName www.example.net </VirtualHost> # IP-based <VirtualHost 172.20.30.50> - DocumentRoot /www/example4 + DocumentRoot "/www/example4" ServerName www.example.edu </VirtualHost> <VirtualHost 172.20.30.60> - DocumentRoot /www/example5 + DocumentRoot "/www/example5" ServerName www.example.gov </VirtualHost> @@ -338,8 +338,8 @@ Listen 80 <VirtualHost *:*> ProxyPreserveHost On - ProxyPass / http://192.168.111.2/ - ProxyPassReverse / http://192.168.111.2/ + ProxyPass "/" "http://192.168.111.2/" + ProxyPassReverse "/" "http://192.168.111.2/" ServerName hostname.example.com </VirtualHost> @@ -358,7 +358,7 @@ Listen 80 <VirtualHost _default_:*> - DocumentRoot /www/default + DocumentRoot "/www/default" </VirtualHost> @@ -384,12 +384,12 @@ Listen 80 <VirtualHost _default_:80> - DocumentRoot /www/default80 + DocumentRoot "/www/default80" # ... </VirtualHost> <VirtualHost _default_:*> - DocumentRoot /www/default + DocumentRoot "/www/default" # ... </VirtualHost> @@ -408,7 +408,7 @@ Listen 80 <VirtualHost _default_:80> -DocumentRoot /www/default +DocumentRoot "/www/default" ... </VirtualHost> @@ -442,16 +442,16 @@ DocumentRoot /www/default Listen 80 ServerName www.example.com -DocumentRoot /www/example1 +DocumentRoot "/www/example1" <VirtualHost 172.20.30.40 172.20.30.50> - DocumentRoot /www/example2 + DocumentRoot "/www/example2" ServerName www.example.org # ... </VirtualHost> <VirtualHost 172.20.30.40> - DocumentRoot /www/example3 + DocumentRoot "/www/example3" ServerName www.example.net ServerAlias *.example.net # ... @@ -479,27 +479,27 @@ DocumentRoot /www/example1 <VirtualHost 172.20.30.40> # primary vhost - DocumentRoot /www/subdomain + DocumentRoot "/www/subdomain" RewriteEngine On - RewriteRule . /www/subdomain/index.html + RewriteRule "." "/www/subdomain/index.html" # ... </VirtualHost> <VirtualHost 172.20.30.40> -DocumentRoot /www/subdomain/sub1 +DocumentRoot "/www/subdomain/sub1" ServerName www.sub1.domain.tld - ServerPath /sub1/ + ServerPath "/sub1/" RewriteEngine On - RewriteRule ^(/sub1/.*) /www/subdomain$1 + RewriteRule "^(/sub1/.*)" "/www/subdomain$1" # ... </VirtualHost> <VirtualHost 172.20.30.40> - DocumentRoot /www/subdomain/sub2 + DocumentRoot "/www/subdomain/sub2" ServerName www.sub2.domain.tld - ServerPath /sub2/ + ServerPath "/sub2/" RewriteEngine On - RewriteRule ^(/sub2/.*) /www/subdomain$1 + RewriteRule "^(/sub2/.*)" "/www/subdomain$1" # ... </VirtualHost> diff --git a/docs/manual/vhosts/ip-based.xml b/docs/manual/vhosts/ip-based.xml index 69c323b3bb..c792cab868 100644 --- a/docs/manual/vhosts/ip-based.xml +++ b/docs/manual/vhosts/ip-based.xml @@ -136,18 +136,18 @@ Virtual Hosts to help you decide.

    <VirtualHost 172.20.30.40:80> ServerAdmin webmaster@www1.example.com - DocumentRoot /www/vhosts/www1 + DocumentRoot "/www/vhosts/www1" ServerName www1.example.com - ErrorLog /www/logs/www1/error_log - CustomLog /www/logs/www1/access_log combined + ErrorLog "/www/logs/www1/error_log" + CustomLog "/www/logs/www1/access_log" combined </VirtualHost> <VirtualHost 172.20.30.50:80> ServerAdmin webmaster@www2.example.org - DocumentRoot /www/vhosts/www2 + DocumentRoot "/www/vhosts/www2" ServerName www2.example.org - ErrorLog /www/logs/www2/error_log - CustomLog /www/logs/www2/access_log combined + ErrorLog "/www/logs/www2/error_log" + CustomLog "/www/logs/www2/access_log" combined </VirtualHost> diff --git a/docs/manual/vhosts/mass.xml b/docs/manual/vhosts/mass.xml index 3a5afcb436..bf5e6fad19 100644 --- a/docs/manual/vhosts/mass.xml +++ b/docs/manual/vhosts/mass.xml @@ -44,20 +44,20 @@ <VirtualHost 111.22.33.44> ServerName customer-1.example.com - DocumentRoot /www/hosts/customer-1.example.com/docs - ScriptAlias /cgi-bin/ /www/hosts/customer-1.example.com/cgi-bin + DocumentRoot "/www/hosts/customer-1.example.com/docs" + ScriptAlias "/cgi-bin/" "/www/hosts/customer-1.example.com/cgi-bin" </VirtualHost> <VirtualHost 111.22.33.44> ServerName customer-2.example.com - DocumentRoot /www/hosts/customer-2.example.com/docs - ScriptAlias /cgi-bin/ /www/hosts/customer-2.example.com/cgi-bin + DocumentRoot "/www/hosts/customer-2.example.com/docs" + ScriptAlias "/cgi-bin/" "/www/hosts/customer-2.example.com/cgi-bin" </VirtualHost> <VirtualHost 111.22.33.44> ServerName customer-N.example.com - DocumentRoot /www/hosts/customer-N.example.com/docs - ScriptAlias /cgi-bin/ /www/hosts/customer-N.example.com/cgi-bin + DocumentRoot "/www/hosts/customer-N.example.com/docs" + ScriptAlias "/cgi-bin/" "/www/hosts/customer-N.example.com/cgi-bin" </VirtualHost> @@ -154,11 +154,11 @@ UseCanonicalName Off # this log format can be split per-virtual-host based on the first field # using the split-logfile utility. LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon -CustomLog logs/access_log vcommon +CustomLog "logs/access_log" vcommon # include the server name in the filenames used to satisfy requests -VirtualDocumentRoot /www/hosts/%0/docs -VirtualScriptAlias /www/hosts/%0/cgi-bin +VirtualDocumentRoot "/www/hosts/%0/docs" +VirtualScriptAlias "/www/hosts/%0/cgi-bin"

    This configuration can be changed into an IP-based virtual @@ -191,10 +191,10 @@ LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon CustomLog logs/access_log vcommon # include part of the server name in the filenames -VirtualDocumentRoot /home/%2/www +VirtualDocumentRoot "/home/%2/www" # single cgi-bin directory -ScriptAlias /cgi-bin/ /www/std-cgi/ +ScriptAlias "/cgi-bin/" "/www/std-cgi/"

    There are examples of more complicated @@ -220,12 +220,12 @@ UseCanonicalName Off LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon -<Directory /www/commercial> +<Directory "/www/commercial"> Options FollowSymLinks AllowOverride All </Directory> -<Directory /www/homepages> +<Directory "/www/homepages"> Options FollowSymLinks AllowOverride None </Directory> @@ -233,19 +233,19 @@ LogFormat "%V %h %l %u %t \"%r\" %s %b" vcommon <VirtualHost 111.22.33.44> ServerName www.commercial.example.com - CustomLog logs/access_log.commercial vcommon + CustomLog "logs/access_log.commercial" vcommon - VirtualDocumentRoot /www/commercial/%0/docs - VirtualScriptAlias /www/commercial/%0/cgi-bin + VirtualDocumentRoot "/www/commercial/%0/docs" + VirtualScriptAlias "/www/commercial/%0/cgi-bin" </VirtualHost> <VirtualHost 111.22.33.45> ServerName www.homepages.example.com - CustomLog logs/access_log.homepages vcommon + CustomLog "logs/access_log.homepages" vcommon - VirtualDocumentRoot /www/homepages/%0/docs - ScriptAlias /cgi-bin/ /www/std-cgi/ + VirtualDocumentRoot "/www/homepages/%0/docs" + ScriptAlias "/cgi-bin/" "/www/std-cgi/" </VirtualHost> @@ -278,11 +278,11 @@ UseCanonicalName DNS # include the IP address in the logs so they may be split LogFormat "%A %h %l %u %t \"%r\" %s %b" vcommon -CustomLog logs/access_log vcommon +CustomLog "logs/access_log" vcommon # include the IP address in the filenames -VirtualDocumentRootIP /www/hosts/%0/docs -VirtualScriptAliasIP /www/hosts/%0/cgi-bin +VirtualDocumentRootIP "/www/hosts/%0/docs" +VirtualScriptAliasIP "/www/hosts/%0/cgi-bin" diff --git a/docs/manual/vhosts/name-based.xml b/docs/manual/vhosts/name-based.xml index c64df7e19d..91e2b5ed11 100644 --- a/docs/manual/vhosts/name-based.xml +++ b/docs/manual/vhosts/name-based.xml @@ -151,12 +151,12 @@ # This first-listed virtual host is also the default for *:80 ServerName www.example.com ServerAlias example.com - DocumentRoot /www/domain + DocumentRoot "/www/domain" </VirtualHost> <VirtualHost *:80> ServerName other.example.com - DocumentRoot /www/otherdomain + DocumentRoot "/www/otherdomain" </VirtualHost> -- 2.50.1