From: Ken Coar Date: Wed, 15 Apr 2015 20:04:05 +0000 (+0000) Subject: * Remove trailing whitespace from a bunch of *.xml files X-Git-Tag: 2.5.0-alpha~3276 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=430aadce59b536d533be35d333eebfe579a94d16;p=apache * Remove trailing whitespace from a bunch of *.xml files * Quoted arguments to Rewrite{Base,Cond,Map,Rule}. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1673945 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/content-negotiation.html.en b/docs/manual/content-negotiation.html.en index 325f275761..8815fcc1c2 100644 --- a/docs/manual/content-negotiation.html.en +++ b/docs/manual/content-negotiation.html.en @@ -134,7 +134,7 @@ Negotiation defines a file suffix as type-map; this is best done with

-
AddHandler type-map .var
+
AddHandler type-map .var

in the server configuration file.

@@ -232,7 +232,7 @@ Negotiation named by the DirectoryIndex directive, if the server is trying to index a directory. If the configuration files specify

-
DirectoryIndex index
+
DirectoryIndex index

then the server will arbitrate between index.html and index.html3 if both are present. If neither diff --git a/docs/manual/content-negotiation.html.fr b/docs/manual/content-negotiation.html.fr index f296bc028c..d6a7920551 100644 --- a/docs/manual/content-negotiation.html.fr +++ b/docs/manual/content-negotiation.html.fr @@ -27,6 +27,8 @@  ko  |  tr 

+
Cette traduction peut être périmée. Vérifiez la version + anglaise pour les changements récents.

Apache HTTPD supporte la négociation de diff --git a/docs/manual/content-negotiation.xml.fr b/docs/manual/content-negotiation.xml.fr index fe3dcd0892..a9c384ee6b 100644 --- a/docs/manual/content-negotiation.xml.fr +++ b/docs/manual/content-negotiation.xml.fr @@ -3,7 +3,7 @@ - + + + + ---[[ +--[[ A simple authentication hook that checks a table containing usernames and passwords of two accounts. ]]-- @@ -400,7 +400,7 @@ end ---[[ +--[[ An advanced authentication checker with a database backend, caching account entries for 1 minute ]]-- @@ -431,13 +431,13 @@ function fetch_password(user) end db:close() end - if accounts[user] then + if accounts[user] then return accounts[user].password else return nil end end - + -- The authentication hook function check_auth(r) local user, pass = parse_auth(r.headers_in['Authorization']) @@ -465,9 +465,9 @@ end

Example 4: Authorization using LuaAuthzProvider

- If you require even more advanced control over your authorization phases, - you can add custom authz providers to help you manage your server. The - example below shows you how you can split a single htpasswd file into + If you require even more advanced control over your authorization phases, + you can add custom authz providers to help you manage your server. The + example below shows you how you can split a single htpasswd file into groups with different permissions:

@@ -481,8 +481,8 @@ LuaAuthzProvider rights /path/to/lua/script.lua rights_handler ---[[ - This script has two user groups; members and admins, and whichever +--[[ + This script has two user groups; members and admins, and whichever is refered to by the "Require rights" directive is checked to see if the authenticated user belongs to this group. ]]-- @@ -515,9 +515,9 @@ end
Example 5: A rudimentary load balancer

- This is an example of how you can create a load balancing mechanism. - In this example, we will be setting/getting the number of requests served - by each backend using IVM variables, and preferring the backend with least + This is an example of how you can create a load balancing mechanism. + In this example, we will be setting/getting the number of requests served + by each backend using IVM variables, and preferring the backend with least requests served in total:

@@ -525,8 +525,8 @@ LuaHookTranslateName /path/to/script.lua proxy_handler ---[[ - This script uses a basic IVM table to determine where to +--[[ + This script uses a basic IVM table to determine where to send the request. ]]-- diff --git a/docs/manual/env.html.en b/docs/manual/env.html.en index 23b95e0025..659cdb52dc 100644 --- a/docs/manual/env.html.en +++ b/docs/manual/env.html.en @@ -141,13 +141,13 @@ late during request processing meaning that directives such as SetEnvIf and RewriteCond will not see the variables set with it. - -
  • When the server looks up a path via an internal - subrequest such as looking - for a DirectoryIndex + +
  • When the server looks up a path via an internal + subrequest such as looking + for a DirectoryIndex or generating a directory listing with mod_autoindex, - per-request environment variables are not inherited in the - subrequest. Additionally, + per-request environment variables are not inherited in the + subrequest. Additionally, SetEnvIf directives are not separately evaluated in the subrequest due to the API phases mod_setenvif takes action in.
  • @@ -418,7 +418,7 @@ and mod_headers allows you to still accept these headers:

    -
    # 
    +
    #
     # The following works around a client sending a broken Accept_Encoding
     # header.
     #
    diff --git a/docs/manual/env.xml b/docs/manual/env.xml
    index d4375cf688..3cda1acc64 100644
    --- a/docs/manual/env.xml
    +++ b/docs/manual/env.xml
    @@ -153,13 +153,13 @@
               SetEnvIf and RewriteCond will not see the
               variables set with it.
    - 
    -          
  • When the server looks up a path via an internal - subrequest such as looking - for a DirectoryIndex + +
  • When the server looks up a path via an internal + subrequest such as looking + for a DirectoryIndex or generating a directory listing with mod_autoindex, - per-request environment variables are not inherited in the - subrequest. Additionally, + per-request environment variables are not inherited in the + subrequest. Additionally, SetEnvIf directives are not separately evaluated in the subrequest due to the API phases mod_setenvif takes action in.
  • @@ -457,7 +457,7 @@ these headers:

    -# +# # The following works around a client sending a broken Accept_Encoding # header. # diff --git a/docs/manual/expr.html.en b/docs/manual/expr.html.en index 176ca7b841..c7b9c81db7 100644 --- a/docs/manual/expr.html.en +++ b/docs/manual/expr.html.en @@ -514,7 +514,7 @@ listfunction ::= listfuncname "(" word ")"
    top

    Example expressions

    - +

    The following examples show how expressions might be used to evaluate requests:

    @@ -533,7 +533,7 @@ listfunction ::= listfuncname "(" word ")"(" word ")"
    - + Example expressions

    The following examples show how expressions might be used to evaluate requests:

    @@ -586,7 +586,7 @@ listfunction ::= listfuncname "(" word ")" # Only allow access to this content during business hours <Directory "/foo/bar/business"> Require expr %{TIME_HOUR} -gt 9 && %{TIME_HOUR} -lt 17 -</Directory> +</Directory> # Check a HTTP header for a list of values <If "%{HTTP:X-example-header} in { 'foo', 'bar', 'baz' }"> diff --git a/docs/manual/handler.xml b/docs/manual/handler.xml index fd37d5603e..0600d3f203 100644 --- a/docs/manual/handler.xml +++ b/docs/manual/handler.xml @@ -156,8 +156,3 @@ AddHandler add-footer .html as to not invade the media type name-space.

    - - - - - diff --git a/docs/manual/howto/access.html.en b/docs/manual/howto/access.html.en index 4fe15647c7..7817bdd1df 100644 --- a/docs/manual/howto/access.html.en +++ b/docs/manual/howto/access.html.en @@ -86,7 +86,7 @@ Require ip ip.address syntax.

    You can insert not to negate a particular requirement. - Note, that since a not is a negation of a value, it cannot + Note, that since a not is a negation of a value, it cannot be used by itself to allow or deny a request, as not true does not constitute false. Thus, to deny a visit using a negation, the block must have one element that evaluates as true or false. @@ -101,11 +101,12 @@ Require ip ip.address

    Visitors coming from that address (10.252.46.165) - will not be able to see the content covered by this directive. If, - instead, you have a machine name, rather than an IP address, you + will not be able to see the content covered by this directive. If, + instead, you have a machine name, rather than an IP address, you can use that.

    -
    Require not host host.example.com
    +
    Require not host host.example.com
    +    

    And, if you'd like to block access from an entire domain, @@ -163,9 +164,9 @@ Require not host gov and 6am, you can do this using mod_rewrite.

    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/access.html.fr b/docs/manual/howto/access.html.fr index 010d95d342..0e1e635021 100644 --- a/docs/manual/howto/access.html.fr +++ b/docs/manual/howto/access.html.fr @@ -24,6 +24,8 @@

    Langues Disponibles:  en  |  fr 

    +
    Cette traduction peut être périmée. Vérifiez la version + anglaise pour les changements récents.

    Le contrôle d'accès fait référence à tout concept de contrôle d'accès à une ressource quelconque. Il est distinct du processus d'authentification et d'autorisation.

    diff --git a/docs/manual/howto/access.xml b/docs/manual/howto/access.xml index f2242a1915..244bc1f1e7 100644 --- a/docs/manual/howto/access.xml +++ b/docs/manual/howto/access.xml @@ -172,9 +172,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/access.xml.fr b/docs/manual/howto/access.xml.fr index 518d9f8f3c..28088c4cc0 100644 --- a/docs/manual/howto/access.xml.fr +++ b/docs/manual/howto/access.xml.fr @@ -1,7 +1,7 @@ - + diff --git a/docs/manual/howto/access.xml.meta b/docs/manual/howto/access.xml.meta index 605822ecb4..c42bb44f51 100644 --- a/docs/manual/howto/access.xml.meta +++ b/docs/manual/howto/access.xml.meta @@ -8,6 +8,6 @@ en - fr + fr diff --git a/docs/manual/howto/auth.html.en b/docs/manual/howto/auth.html.en index b22c1cbc86..023538b83d 100644 --- a/docs/manual/howto/auth.html.en +++ b/docs/manual/howto/auth.html.en @@ -506,13 +506,15 @@ Require group GroupName that will be called during the authorization stage of the request processing. For example:

    -
    Require ip address
    +
    Require ip address
    +        

    where address is an IP address (or a partial IP address) or:

    -
    Require host domain_name
    +
    Require host domain_name
    +        

    where domain_name is a fully qualified domain name diff --git a/docs/manual/howto/auth.xml.fr b/docs/manual/howto/auth.xml.fr index dc50e4cc02..f80cb393f1 100644 --- a/docs/manual/howto/auth.xml.fr +++ b/docs/manual/howto/auth.xml.fr @@ -1,7 +1,7 @@ - + diff --git a/docs/manual/howto/auth.xml.ja b/docs/manual/howto/auth.xml.ja index 32cb4bbe6b..578700dd4d 100644 --- a/docs/manual/howto/auth.xml.ja +++ b/docs/manual/howto/auth.xml.ja @@ -1,7 +1,7 @@ - + + + + diff --git a/docs/manual/howto/public_html.xml.ja b/docs/manual/howto/public_html.xml.ja index 95f63feb35..130259a8a1 100644 --- a/docs/manual/howto/public_html.xml.ja +++ b/docs/manual/howto/public_html.xml.ja @@ -1,7 +1,7 @@ - + + + - + Miscellaneous Documentation - + Performance Scaling - +

    - -

    The Performance Tuning page in the Apache 1.3 documentation says: + +

    The Performance Tuning page in the Apache 1.3 documentation says:

    "Apache is a general webserver, which is designed to be @@ -44,16 +44,16 @@ The classic brochureware site is alive and well, but the web has grown up substantially as a computing application platform and webmasters may find themselves running dynamic content in Perl, PHP - or Java, all of which take a toll on performance. + or Java, all of which take a toll on performance.

    Therefore, in spite of strides forward in machine speed and bandwidth allowances, web server performance and web application performance remain areas of concern. In this documentation several - aspects of web server performance will be discussed. + aspects of web server performance will be discussed.

    - +
    - +
    What Will and Will Not Be Discussed @@ -65,11 +65,11 @@ server hardware, so the existing infrastructure will have to do the job. You have no desire to compile your own Apache, or to recompile the operating system kernel. We do assume, though, that you have - some familiarity with the Apache httpd configuration file. + some familiarity with the Apache httpd configuration file.

    - +
    - +
    Monitoring Your Server @@ -77,15 +77,15 @@ find out how your system is currently performing. By monitoring your server under real-world load, or artificially generated load, you can extrapolate its behavior under stress, such as when your - site is mentioned on Slashdot. + site is mentioned on Slashdot.

    - - + +
    Monitoring Tools - - + +
    top @@ -102,9 +102,9 @@ ID, priority and nice values, memory footprint, and percentage CPU usage. The following example shows multiple httpd processes (with MPM worker and event) running on an - Linux (Xen) system: + Linux (Xen) system:

    - +
     top - 23:10:58 up 71 days,  6:14,  4 users,  load average: 0.25, 0.53, 0.47
     Tasks: 163 total,   1 running, 162 sleeping,   0 stopped,   0 zombie
    @@ -139,7 +139,7 @@ Swap:  4194296k total,   860584k used,  3333712k free,  1157552k cached
        68 root      15  -5     0    0    0 S    0  0.0   0:06.28 kblockd/0
        69 root      15  -5     0    0    0 S    0  0.0   0:00.04 kblockd/1
        70 root      15  -5     0    0    0 S    0  0.0   0:00.04 kblockd/2
    - +

    Top is a wonderful tool even though it's slightly resource intensive (when running, its own process is usually in the top ten CPU gluttons). It is indispensable in determining @@ -147,7 +147,7 @@ Swap: 4194296k total, 860584k used, 3333712k free, 1157552k cached determining how many server processes you can run on your machine. How to do this is described in sizing MaxClients. Top is, however, an interactive tool and running it - continuously has few if any advantages. + continuously has few if any advantages.

    @@ -159,9 +159,9 @@ Swap: 4194296k total, 860584k used, 3333712k free, 1157552k cached both with and without this cache. The free command can be used to find out how much memory the operating system is using, as described in the paragraph sizing MaxClients. - The output of free looks like this: + The output of free looks like this:

    - +
     sctemme@brutus:~$ free
                   total       used     free   shared    buffers    cached
    @@ -170,7 +170,7 @@ Mem:        4026028    3901892   124136         0    253144    841044
     Swap:       3903784      12540  3891244
                     
    - +
    vmstat @@ -185,13 +185,13 @@ Swap: 3903784 12540 3891244 much memory is swapped in and out each second, the number of processes currently running and sleeping, the number of interrupts and context switches per second and the usage - percentages of the CPU. + percentages of the CPU.

    - The following is vmstat output of an idle server: + The following is vmstat output of an idle server:

    - - + +
     [sctemme@GayDeceiver sctemme]$ vmstat 5 3
        procs                      memory     swap         io    system        cpu
    @@ -200,11 +200,11 @@ Swap:       3903784      12540  3891244
      0 0 0        0 186244   6696 37516    0    0    0    16 41    314  0   0 100
      0 0 0        0 186236   6704 37516    0    0    0     9 44    314  0   0 100
                       
    - +

    And this is output of a server that is under a load of one - hundred simultaneous connections fetching static content: + hundred simultaneous connections fetching static content:

    - +
     [sctemme@GayDeceiver sctemme]$ vmstat 5 3
        procs                      memory     swap    io      system       cpu
    @@ -213,14 +213,14 @@ Swap:       3903784      12540  3891244
      6 0 1        0 163280   6856 40248    0    0  0 66 6384 1117   42 25  32
     11 0 0        0 162780   6864 40436    0    0  0 61 6309 1165   33 28  40
                       
    - +

    The first line gives averages since the last reboot. The subsequent lines give information for five second intervals. The second argument tells vmstat to generate - three reports and then exit. + three reports and then exit.

    - - + +
    SE Toolkit @@ -234,7 +234,7 @@ Swap: 3903784 12540 3891244 orange or red indicators when utilization of various parts of the system rises above certain thresholds. Another included script, Virtual Adrian, applies performance tuning - metrics according to. + metrics according to. </p> <p>The SE Toolkit has drifted around for a while and has had several owners since its inception. It seems that it has @@ -244,20 +244,20 @@ Swap: 3903784 12540 3891244 code. SE Toolkit author Richard Pettit has started a new company, Captive Metrics4 that plans to bring to market a multiplatform monitoring tool built on the same principles - as SE Toolkit, written in Java. + as SE Toolkit, written in Java. </p> - - + + </section> <section id="dtrace"> <title>DTrace

    Given that DTrace is available for Solaris, FreeBSD and OS X, it might be worth exploring it. There's also - mod_dtrace available for httpd. + mod_dtrace available for httpd.

    - - + +
    mod_status @@ -273,10 +273,10 @@ Swap: 3903784 12540 3891244 directive in your <code>httpd.conf</code>, the <module>mod_status</module> page will give you more information at the cost of a little - extra work per request. + extra work per request. </p> - - + + </section> </section> <section id="web-server-log-files"> @@ -291,10 +291,10 @@ Swap: 3903784 12540 3891244 from. Historical log file data can give you invaluable insight into trends in access to your server, which allows you to predict when your performance needs will overtake your server - capacity. + capacity. </p> - - + + <section id="ErrorLog"> <title>Error Log @@ -307,7 +307,7 @@ Swap: 3903784 12540 3891244 redirected to the error logfile, so any error encountered by httpd after it opens its logfiles will appear in this log. This makes it good practice to review the error log - frequently. + frequently.

    Before Apache httpd opens its logfiles, any errors will be written to the stderr stream. If you start httpd manually, @@ -319,7 +319,7 @@ Swap: 3903784 12540 3891244 file is usually a good bet. On Windows, early error messages are written to the Applications Event Log, which can be viewed through the Event Viewer in Administrative - Tools. + Tools.

    The Error Log is configured through the ErrorLog @@ -331,7 +331,7 @@ Swap: 3903784 12540 3891244 directive can also be used in virtual host containers. The error log of a virtual host receives only log messages specific to that virtual host, such as authentication - failures and 'File not Found' errors. + failures and 'File not Found' errors.

    On a server that is visible to the Internet, expect to see a lot of exploit attempt and worm attacks in the error log. A @@ -341,12 +341,12 @@ Swap: 3903784 12540 3891244 port, regardless of which server is actually running or what applications might be installed. You could block these attempts using a firewall or mod_security, - but this falls outside the scope of this discussion. + but this falls outside the scope of this discussion.

    The LogLevel directive determines the level of detail included in the - logs. There are eight log levels as described here: + logs. There are eight log levels as described here:

    @@ -426,19 +426,19 @@ Swap: 3903784 12540 3891244 not be run on debug, but increasing the level of detail in the error log can be useful during troubleshooting. Starting with 2.3.8 LogLevel - can be specified on a per module basis: + can be specified on a per module basis:

    - + LogLevel debug mod_ssl:warn - +

    This puts all of the server in debug mode, except for - mod_ssl, which tends to be very noisy. + mod_ssl, which tends to be very noisy.

    - - + +
    Access Log @@ -451,7 +451,7 @@ Swap: 3903784 12540 3891244 manual. This file exists by default for the main server and can be configured per virtual host by using the <directive module="mod_log_config">TransferLog</directive> or <directive module="mod_log_config">CustomLog</directive> - configuration directive. + configuration directive. </p> <p>The access logs can be analyzed with any of several free and commercially available programs. Popular free analysis @@ -459,10 +459,10 @@ Swap: 3903784 12540 3891244 be done offline so the web server machine is not burdened by processing the log files. Most log analysis packages understand the Common Log Format. The fields in the log - lines are explained in in the following: + lines are explained in in the following: </p> - - + + <example><pre> 195.54.228.42 - - [24/Mar/2007:23:05:11 -0400] "GET /sander/feed/ HTTP/1.1" 200 9747 64.34.165.214 - - [24/Mar/2007:23:10:11 -0400] "GET /sander/feed/atom HTTP/1.1" 200 9068 @@ -472,7 +472,7 @@ Swap: 3903784 12540 3891244 74.6.72.187 - - [24/Mar/2007:23:18:11 -0400] "GET /sander/2006/09/27/44/ HTTP/1.0" 200 14172 74.6.72.229 - - [24/Mar/2007:23:24:22 -0400] "GET /sander/2006/11/21/os-java/ HTTP/1.0" 200 13457 </pre></example> - + <table> <tr> <td> @@ -563,7 +563,7 @@ Swap: 3903784 12540 3891244 </td> </tr> </table> - + </section> <section id="rotating-log-files"> <title>Rotating Log Files @@ -575,17 +575,17 @@ Swap: 3903784 12540 3891244 file analysis should not be performed on files to which the server is actively writing. Periodic logfile rotation helps keep the analysis job manageable, and allows you to keep a - closer eye on usage trends. + closer eye on usage trends. </p> <p>On unix systems, you can simply rotate logfiles by giving the old file a new name using mv. The server will keep writing to the open file even though it has a new name. When you send a graceful restart signal to the server, it will open a new logfile with the configured name. For - example, you could run a script from cron like this: + example, you could run a script from cron like this: </p> - - + + <example> APACHE=/usr/local/apache2<br /> HTTPD=$APACHE/bin/httpd<br /> @@ -593,7 +593,7 @@ Swap: 3903784 12540 3891244 $APACHE/logarchive/access_log-`date +%F`<br /> $HTTPD -k graceful </example> - + <p>This approach also works on Windows, just not as smoothly. While the httpd process on your Windows server will keep writing to the log file after it has been renamed, the @@ -607,7 +607,7 @@ Swap: 3903784 12540 3891244 Windows Service has to perform will interrupt any requests currently in progress, and the server is unavailable until it is started again. Plan for this when you decide the - timing of your restarts. + timing of your restarts. </p> <p> A second approach is to use piped logs. From the @@ -616,13 +616,13 @@ Swap: 3903784 12540 3891244 or <directive module="core">ErrorLog </directive> directives you can send the log data into any program using - a pipe character (<code>|</code>). For instance: + a pipe character (<code>|</code>). For instance: </p> - + <example>CustomLog "|/usr/local/apache2/bin/rotatelogs /var/log/access_log 86400" common </example> - + <p>The program on the other end of the pipe will receive the Apache log data on its stdin stream, and can do with this data whatever it wants. The rotatelogs program that comes @@ -630,10 +630,10 @@ Swap: 3903784 12540 3891244 time elapsed or the amount of data written, and leaves the old log files with a timestamp suffix to its name. This method for rotating logfiles works well on unix platforms, - but is currently broken on Windows. + but is currently broken on Windows. </p> - - + + </section> <section id="logging-and-performance"> <title>Logging and Performance @@ -646,7 +646,7 @@ Swap: 3903784 12540 3891244 the server log files: the access patterns are very different. Retrieving content from disk is a read operation in a fairly random pattern, and log files are written to - disk sequentially. + disk sequentially. </p> <p> Do not run a production server with your error <directive module="core">LogLevel</directive> @@ -654,7 +654,7 @@ Swap: 3903784 12540 3891244 information to be written to the error log, including, in the case of SSL access, complete dumps of BIO read and write operations. The performance implications are - significant: use the default warn level instead. + significant: use the default warn level instead. </p> <p>If your server has more than one virtual host, you may give each virtual host a separate access logfile. This makes it @@ -675,10 +675,10 @@ Swap: 3903784 12540 3891244 directive to have Apache collect several log lines in memory before writing them to disk. This might yield better performance, but could affect the order in which the - server's log is written. + server's log is written. </p> - - + + </section> </section> <section id="generating-a-test-load"> @@ -688,7 +688,7 @@ Swap: 3903784 12540 3891244 performance under realistic operating circumstances. Besides commercial packages such as <a href="http://learnloadrunner.com/">LoadRunner</a> ,there are a number of freely available tools to generate a - test load against your web server. + test load against your web server. </p> <ul> <li>Apache ships with a test program called ab, short for @@ -696,20 +696,20 @@ Swap: 3903784 12540 3891244 repeatedly asking for the same file in rapid succession. You can specify a number of concurrent connections and have the program run for either a given amount of time or a - specified number of requests. + specified number of requests. </li> <li>Another freely available load generator is http load11 . This program works with a URL file and can be compiled with - SSL support. + SSL support. </li> <li>The Apache Software Foundation offers a tool named flood12 . Flood is a fairly sophisticated program that is - configured through an XML file. + configured through an XML file. </li> <li>Finally, JMeter13 , a Jakarta subproject, is an all-Java load-testing tool. While early versions of this application were slow and difficult to use, the current version 2.1.1 - seems to be versatile and useful. + seems to be versatile and useful. </li> <li> <p>ASF external projects, that have proven to be quite @@ -722,15 +722,15 @@ Swap: 3903784 12540 3891244 affect the server's response. Also, any data traffic you generate may be charged against your monthly traffic allowance. </p> - - + + </section> </section> <section id="configuring-for-performance"> <title>Configuring for Performance - - + +
    Httpd Configuration @@ -748,7 +748,7 @@ Swap: 3903784 12540 3891244 multiple request handling threads within each child process. In 2.4 MPMs are no longer hard-wired. They too can be exchanged via LoadModule. - The default MPM in 2.4 is the event MPM. + The default MPM in 2.4 is the event MPM.

    The maximum number of workers, be they pre-forked child processes or threads within a process, is an indication of how @@ -758,7 +758,7 @@ Swap: 3903784 12540 3891244 the maximum number of workers is running, the machine doesn't hit a hard limit beyond which clients will be denied access. However, once requests start backing up, system - performance is likely to degrade. + performance is likely to degrade.

    Finally, if the httpd server in question is not executing any third-party code, via mod_php, mod_perl or similar, @@ -766,8 +766,8 @@ Swap: 3903784 12540 3891244 for situations where httpd serves as a thin layer between clients and backend servers doing the real job, such as a proxy or cache.

    - - + +
    MaxClients @@ -784,10 +784,10 @@ Swap: 3903784 12540 3891244 number of processes is configurable through the ServerLimit - directive. + directive.

    - - + +
    Spinning Threads @@ -809,8 +809,8 @@ Swap: 3903784 12540 3891244 value downwards until it is an even factor of <code>MaxClients</code>. </p> - - + + </section> <section id="sizing-maxClients"> <title>Sizing MaxClients @@ -820,16 +820,16 @@ Swap: 3903784 12540 3891244 your system gets so overloaded that it needs to heavily swap core memory out to disk, performance will degrade quickly. The formula for determining <directive module="mpm_common" name="MaxRequestWorkers">MaxClients</directive> - is fairly simple: + is fairly simple: </p> - + <example> total RAM - RAM for OS - RAM for external programs<br /> MaxClients = -------------------------------------------------------<br /> RAM per httpd process </example> - + <p>The various amounts of memory allocated for the OS, external programs and the httpd processes is best determined by observation: use the top and free commands described above @@ -837,7 +837,7 @@ Swap: 3903784 12540 3891244 server running. You can also determine the footprint of a typical web server process from top: most top implementations have a Resident Size (RSS) column and a - Shared Memory column. + Shared Memory column. </p> <p>The difference between these two is the amount of memory per-process. The shared segment really exists only once and @@ -847,7 +847,7 @@ Swap: 3903784 12540 3891244 depends heavily on the number and kind of modules you use. The best approach to use in determining this need is to generate a typical test load against your web site and see - how large the httpd processes become. + how large the httpd processes become. </p> <p>The RAM for external programs parameter is intended mostly for CGI programs and scripts that run outside the web @@ -867,10 +867,10 @@ Swap: 3903784 12540 3891244 to fork additional child processes, so a higher <code> MaxClients </code> - value may actually be a disadvantage. + value may actually be a disadvantage. </p> - - + + </section> <section id="selecting-your-mpm"> <title>Selecting your MPM @@ -885,7 +885,7 @@ Swap: 3903784 12540 3891244 sense. On Linux, the threading implementation actually uses one process for each thread. Linux processes are relatively lightweight, but it means that a threaded MPM offers less - of a performance advantage than in other environments. + of a performance advantage than in other environments. </p> <p>Running a threaded MPM can cause stability problems in some situations For instance, should a child process of a @@ -904,10 +904,10 @@ Swap: 3903784 12540 3891244 cannot guarantee that all of these are thread-safe. The good news is that if you are running Apache on Linux, you can run PHP in the preforked MPM without fear of losing too - much performance relative to the threaded option. + much performance relative to the threaded option. </p> - - + + </section> <section id="spinning-locks"> <title>Spinning Locks @@ -929,10 +929,10 @@ Swap: 3903784 12540 3891244 this time, the parent process may decide to terminate some children based on its <code>MaxSpareServers </code> - directive. + directive. </p> - - + + </section> <section id="the-thundering-herd"> <title>The Thundering Herd @@ -940,7 +940,7 @@ Swap: 3903784 12540 3891244 <p>The function of the 'accept mutex' (as this inter-process lock is called) is to keep request reception moving along in an orderly fashion. If the lock is absent, - the server may exhibit the Thundering Herd syndrome. + the server may exhibit the Thundering Herd syndrome. </p> <p>Consider an American Football team poised on the line of scrimmage. If the football players were Apache processes @@ -949,7 +949,7 @@ Swap: 3903784 12540 3891244 would have to lumber back to the line for the next snap. In this metaphor, the accept mutex acts as the quarterback, delivering the connection "ball" to the - appropriate player process. + appropriate player process. </p> <p>Moving this much information around is obviously a lot of work, and, like a smart person, a smart web server tries to @@ -962,7 +962,7 @@ Swap: 3903784 12540 3891244 refrain from using an accept mutex. If you run with multiple listeners (for instance because you have a virtual host serving SSL requests), it will activate the accept - mutex to avoid internal conflicts. + mutex to avoid internal conflicts. </p> <p> You can manipulate the accept mutex with the <code> @@ -974,15 +974,15 @@ Swap: 3903784 12540 3891244 all are available on every platform, and their availability also depends on compile-time settings. The various locking mechanisms may place specific demands on system resources: - manipulate them with care. + manipulate them with care. </p> <p>There is no compelling reason to disable the accept mutex. Apache automatically recognizes the single listener situation described above and knows if it is safe to run - without mutex on your platform. + without mutex on your platform. </p> - - + + </section> </section> <section id="tuning-the-operating-system"> @@ -994,10 +994,10 @@ Swap: 3903784 12540 3891244 are pretty well adjusted straight out of the box and there is not a lot that needs to be done to make them perform optimally. However, there are a few things that an administrator can do to - improve performance. + improve performance. </p> - - + + <section id="ram-and-swap-space"> <title>RAM and Swap Space @@ -1010,7 +1010,7 @@ Swap: 3903784 12540 3891244 virtual hosts-also tends to inflate the process footprint. Having ample RAM allows you to run Apache with more child processes, which allows the server to process more - concurrent requests. + concurrent requests.

    While the various platforms treat their virtual memory in different ways, it is never a good idea to run with less @@ -1019,7 +1019,7 @@ Swap: 3903784 12540 3891244 don't have disk space available and run out of swappable memory, your machine grinds to a halt. This can crash your box, requiring a physical reboot for which your - hosting facility may charge you. + hosting facility may charge you.

    Also, such an outage naturally occurs when you least want it: when the world has found your website and is beating a @@ -1029,7 +1029,7 @@ Swap: 3903784 12540 3891244 and back, but when the load decreases the system should recover. Remember, you still have MaxClients - to keep things in hand. + to keep things in hand.

    Most unix-like operating systems use designated disk partitions for swap space. When a system starts up it finds @@ -1040,7 +1040,7 @@ Swap: 3903784 12540 3891244 installing the operating system, be sure to allocate enough swap space to accommodate eventual RAM upgrades. Reassigning disk space on a running system is a cumbersome - process. + process.

    Plan for available hard drive swap space of at least twice your amount of RAM, perhaps up to four times in situations @@ -1054,29 +1054,29 @@ Swap: 3903784 12540 3891244 or swap - programs. + programs.

    - - + +
    ulimit: Files and Processes

    Given a machine with plenty of RAM and processor capacity, you can run hundreds of Apache processes if necessary. . . - and if your kernel allows it. + and if your kernel allows it.

    Consider a situation in which several hundred web servers are running; if some of these need to spawn CGI processes, - the maximum number of processes would occur quickly. + the maximum number of processes would occur quickly.

    -

    However, you can change this limit with the command +

    However, you can change this limit with the command

    - + ulimit [-H|-S] -u [newvalue] - +

    This must be changed before starting the server, since the new value will only be available to the current shell and programs started from it. In newer Linux kernels the @@ -1090,28 +1090,28 @@ Swap: 3903784 12540 3891244 :

    - + limit [-h] maxproc [newvalue] - +

    Similarly, the kernel may limit the number of open files per process. This is generally not a problem for pre-forked servers, which just handle one request at a time per process. Threaded servers, however, serve many requests per process and much more easily run out of available file descriptors. You can increase the maximum number of open - files per process by running the + files per process by running the

    - + ulimit -n [newvalue] - +

    command. Once again, this must be done prior to starting - Apache. + Apache.

    - - + +
    Setting User Limits on System Startup @@ -1124,15 +1124,15 @@ Swap: 3903784 12540 3891244 explaining the options. To enable this, make sure that the file <code>/etc/pam.d/login </code> - contains the line + contains the line </p> - + <example>session required /lib/security/pam_limits.so </example> - + <p>All items can have a 'soft' and a 'hard' limit: the first is the default setting and the second the - maximum value for that item. + maximum value for that item. </p> <p> In FreeBSD's <code>/etc/login.conf @@ -1148,27 +1148,27 @@ Swap: 3903784 12540 3891244 boot time. These are the same tunables that can be set with the <code>mdb</code> kernel debugger during run time. The soft and hard limit - corresponding to ulimit -u can be set via: + corresponding to ulimit -u can be set via: </p> - + <example> set rlim_fd_max=65536<br /> set rlim_fd_cur=2048 </example> - + <p>Solaris calculates the maximum number of allowed processes per user (<code>maxuprc</code>) based on the total amount available memory on the system (<code>maxusers</code>). - You can review the numbers with + You can review the numbers with </p> - + <example>sysdef -i | grep maximum </example> - - <p>but it is not recommended to change them. + + <p>but it is not recommended to change them. </p> - - + + </section> <section id="turn-off-unused-services-and-modules"> <title>Turn Off Unused Services and Modules @@ -1177,19 +1177,19 @@ Swap: 3903784 12540 3891244 services turned on by default. You probably need few of them. For example, your web server does not need to be running sendmail, nor is it likely to be an NFS server, - etc. Turn them off. + etc. Turn them off. </p> <p>On Red Hat Linux, the chkconfig tool will help you do this from the command line. On Solaris systems <code>svcs</code> and <code>svcadm</code> will show which services are enabled and disable them - respectively. + respectively. </p> <p>In a similar fashion, cast a critical eye on the Apache modules you load. Most binary distributions of Apache httpd, and pre-installed versions that come with Linux distributions, have their modules enabled through the - <directive>LoadModule</directive> directive. + <directive>LoadModule</directive> directive. </p> <p>Unused modules may be culled: if you don't rely on their functionality and configuration directives, you can @@ -1198,10 +1198,10 @@ Swap: 3903784 12540 3891244 lines. Read the documentation on each module's functionality before deciding whether to keep it enabled. While the performance overhead of an unused module is - small, it's also unnecessary. + small, it's also unnecessary. </p> - - + + </section> </section> </section> @@ -1213,7 +1213,7 @@ Swap: 3903784 12540 3891244 Static content consists of simple filespages, images, etc.-on disk that are very efficiently served. Many operating systems also automatically cache the contents of frequently accessed files in - memory. + memory. </p> <p>Processing dynamic requests, on the contrary, can be much more involved. Running CGI scripts, handing off requests to an external @@ -1221,10 +1221,10 @@ Swap: 3903784 12540 3891244 significant latency and processing load to a busy web server. Under many circumstances, performance can be improved by turning popular dynamic requests into static requests. In this section, two - approaches to this will be discussed. + approaches to this will be discussed. </p> - - + + <section id="making-popular-pages-static"> <title>Making Popular Pages Static @@ -1238,34 +1238,34 @@ Swap: 3903784 12540 3891244 they are served the pre-rendered page. Queries for, say, yellow roses will be generated directly from the database. The mod_rewrite module included with Apache is a great tool to - implement these substitutions. + implement these substitutions.

    - - + +
    Example: A Statically Rendered Blog - +

    Blosxom is a lightweight web log package that runs as a CGI. It is written in Perl and uses plain text files for entry input. Besides running as CGI, Blosxom can be run from the command line to pre-render blog pages. Pre-rendering pages to static HTML can yield a significant performance boost in the event that large numbers of people actually start - reading your blog. + reading your blog.

    To run blosxom for static page generation, edit the CGI script according to the documentation. Set the $static dir variable to the DocumentRoot of the web server, and run the script from the command line - as follows: + as follows:

    - + $ perl blosxom.cgi -password='whateveryourpassword' - +

    This can be run periodically from Cron, after you upload content, etc. To make Apache substitute the statically rendered pages for the dynamic content, we'll use @@ -1275,9 +1275,9 @@ Swap: 3903784 12540 3891244 to the configure command. Many binary distributions of Apache come with mod_rewrite included. The following is an example of an Apache virtual host that takes advantage of - pre-rendered blog pages: + pre-rendered blog pages:

    - + Listen *:8001 <VirtualHost *:8001> @@ -1288,11 +1288,11 @@ Listen *:8001 Options +Indexes Require all granted RewriteEngine on - RewriteCond %{REQUEST_FILENAME} !-f - RewriteCond %{REQUEST_FILENAME} !-d - RewriteRule ^(.*)$ /cgi-bin/blosxom.cgi/$1 [L,QSA] + RewriteCond "%{REQUEST_FILENAME}" "!-f" + RewriteCond "%{REQUEST_FILENAME}" "!-d" + RewriteRule "^(.*)$" "/cgi-bin/blosxom.cgi/$1" [L,QSA] </Directory> - RewriteLog /home/sctemme/inst/blog/httpd/logs/rewrite_log + RewriteLog "/home/sctemme/inst/blog/httpd/logs/rewrite_log" RewriteLogLevel 9 ErrorLog /home/sctemme/inst/blog/httpd/logs/error_log LogLevel debug @@ -1304,7 +1304,7 @@ Listen *:8001 </Directory> </VirtualHost> - +

    The RewriteCond and RewriteRule @@ -1321,10 +1321,10 @@ Listen *:8001 hides the Blosxom CGI from the user-visible URL in their Location bar. mod_rewrite is a fantastically powerful and versatile module: investigate it to arrive at a - configuration that is best for your situation. + configuration that is best for your situation.

    - - + +
    @@ -1341,12 +1341,12 @@ Listen *:8001 server systems will have more disk available than memory, and it's good to note that some operating system kernels cache frequently accessed disk content transparently in memory, so - replicating this in the server is not very useful. + replicating this in the server is not very useful.

    To enable efficient content caching and avoid presenting the user with stale or invalid content, the application that generates the actual content has to send the correct response - headers. Without headers like Etag:, + headers. Without headers like Etag:, Last-Modified: or Expires:, mod_cache can not make the right decision on whether to cache the content, serve it from cache or leave it alone. When @@ -1357,10 +1357,10 @@ Listen *:8001 option --enable-cache[=shared] to the configure script. If you use a binary distribution of Apache httpd, or it came with your port or package collection, - it may have mod_cache already included. + it may have mod_cache already included.

    - - + +
    Example: wiki.apache.org @@ -1384,7 +1384,7 @@ Listen *:8001 enabled with the following configuration snippet in httpd.conf:

    - + CacheRoot /raid1/cacheroot CacheEnable disk / @@ -1393,7 +1393,7 @@ CacheLastModifiedFactor .1 # Always check again after 6 hours CacheMaxExpire 21600 - +

    This configuration will try to cache any and all content within its virtual host. It will never cache content for more than six hours (the CacheMaxExpire @@ -1403,7 +1403,7 @@ CacheMaxExpire 21600 header. The computation using CacheLastModifiedFactor is based on the assumption that if a page was recently modified, it is likely to change again in the near future - and will have to be re-cached. + and will have to be re-cached.

    Do note that it can pay off to disable @@ -1416,21 +1416,21 @@ CacheMaxExpire 21600 TCP packet). For resources larger than 1k it might prove CPU expensive to calculate the header for each request. Unfortunately there does currently not exist a way to cache - these headers. + these headers.

    <FilesMatch "\.(jpe?g|png|gif|js|css|x?html|xml)"> FileETag None </FilesMatch> - +

    This will disable the generation of the ETag: header for most static resources. The server does not - calculate these headers for dynamic resources. + calculate these headers for dynamic resources.

    - - + +
    diff --git a/docs/manual/misc/perf-tuning.html.en b/docs/manual/misc/perf-tuning.html.en index b698fd0550..7ad5e2e7d5 100644 --- a/docs/manual/misc/perf-tuning.html.en +++ b/docs/manual/misc/perf-tuning.html.en @@ -405,10 +405,10 @@ one connection at a time. Worker generally is a good choice for high-traffic servers because it has a smaller memory footprint than the prefork MPM. - -
  • The event MPM is threaded like the - Worker MPM, but is designed to allow more requests to be - served simultaneously by passing off some processing work + +
  • The event MPM is threaded like the + Worker MPM, but is designed to allow more requests to be + served simultaneously by passing off some processing work to supporting threads, freeing up the main threads to work on new requests.
  • @@ -612,7 +612,7 @@ accept_mutex_on (); for (;;) { fd_set accept_fds; - + FD_ZERO (&accept_fds); for (i = first_socket; i <= last_socket; ++i) { FD_SET (i, &accept_fds); @@ -742,7 +742,7 @@
            void lingering_close (int s)
             {
               char junk_buffer[2048];
    -          
    +
               /* shutdown the sending side */
               shutdown (s, 1);
     
    @@ -759,7 +759,7 @@
                   /* just toss away whatever is here */
                 }
               }
    -          
    +
               close (s);
             }
    diff --git a/docs/manual/misc/perf-tuning.xml.fr b/docs/manual/misc/perf-tuning.xml.fr index 6825728c6e..00b64541d2 100644 --- a/docs/manual/misc/perf-tuning.xml.fr +++ b/docs/manual/misc/perf-tuning.xml.fr @@ -1,7 +1,7 @@ - + diff --git a/docs/manual/misc/perf-tuning.xml.ko b/docs/manual/misc/perf-tuning.xml.ko index 293913b33f..4f4b05fb9a 100644 --- a/docs/manual/misc/perf-tuning.xml.ko +++ b/docs/manual/misc/perf-tuning.xml.ko @@ -1,7 +1,7 @@ - + + + diff --git a/docs/manual/misc/security_tips.xml.ko b/docs/manual/misc/security_tips.xml.ko index 96b078e46a..c2a52723ac 100644 --- a/docs/manual/misc/security_tips.xml.ko +++ b/docs/manual/misc/security_tips.xml.ko @@ -1,7 +1,7 @@ - + + + + + diff --git a/docs/manual/mod/core.xml.ja b/docs/manual/mod/core.xml.ja index f061198bc8..06cb68e85f 100644 --- a/docs/manual/mod/core.xml.ja +++ b/docs/manual/mod/core.xml.ja @@ -1,7 +1,7 @@ - + + + diff --git a/docs/manual/mod/mod_asis.xml.ja b/docs/manual/mod/mod_asis.xml.ja index c8e3052597..96f369ceb9 100644 --- a/docs/manual/mod/mod_asis.xml.ja +++ b/docs/manual/mod/mod_asis.xml.ja @@ -1,7 +1,7 @@ - + + + diff --git a/docs/manual/mod/mod_autoindex.html.en b/docs/manual/mod/mod_autoindex.html.en index 4e649e2165..20206a6c3b 100644 --- a/docs/manual/mod/mod_autoindex.html.en +++ b/docs/manual/mod/mod_autoindex.html.en @@ -71,7 +71,7 @@ same header repeatedly toggles between ascending and descending order. These column header links are suppressed with the IndexOptions directive's - SuppressColumnSorting + SuppressColumnSorting option.

    Note that when the display is sorted by "Size", it's the @@ -328,7 +328,7 @@ AddDescription "My friend Marshall" friends/mars.gif

    Arguments with path information

    Absolute paths are not currently supported and do not match anything at runtime. Arguments with relative path information, - which would normally only be used in htaccess context, are implicitly + which would normally only be used in htaccess context, are implicitly prefixed with '*/' to avoid matching partial directory names.

    @@ -658,7 +658,7 @@ indexing
    FoldersFirst is enabled, subdirectory Zed will be listed before subdirectory Beta, which will be listed before normal files - Gamma and Alpha. + Gamma and Alpha. This option only has an effect if FancyIndexing is also enabled. @@ -685,7 +685,7 @@ indexing to wait until all the images have been loaded. If no value is given for the option, it defaults to the standard height of the icons supplied with the Apache httpd software. - + This option only has an effect if FancyIndexing is also enabled. @@ -763,7 +763,7 @@ indexing space to use for something else. See AddDescription for information about setting the file description. See also the DescriptionWidth index option to limit the size of the description column. - + This option only has an effect if FancyIndexing is also enabled. @@ -797,7 +797,7 @@ indexing
    This will suppress the display of the last modification date, in fancy indexing listings. - + This option only has an effect if FancyIndexing is also enabled.
    @@ -811,7 +811,7 @@ indexing by the final specification prohibits img and hr elements from the pre block (used to format FancyIndexed listings.) - + This option only has an effect if FancyIndexing is also enabled. @@ -820,7 +820,7 @@ indexing
    SuppressSize
    This will suppress the file size in fancy indexing listings. - + This option only has an effect if FancyIndexing is also enabled.
    diff --git a/docs/manual/mod/mod_autoindex.xml b/docs/manual/mod/mod_autoindex.xml index 9898bc8722..55e2c9fdd0 100644 --- a/docs/manual/mod/mod_autoindex.xml +++ b/docs/manual/mod/mod_autoindex.xml @@ -69,7 +69,7 @@ same header repeatedly toggles between ascending and descending order. These column header links are suppressed with the IndexOptions directive's - SuppressColumnSorting + SuppressColumnSorting option.

    Note that when the display is sorted by "Size", it's the @@ -320,7 +320,7 @@ AddDescription "My friend Marshall" friends/mars.gif Arguments with path information

    Absolute paths are not currently supported and do not match anything at runtime. Arguments with relative path information, - which would normally only be used in htaccess context, are implicitly + which would normally only be used in htaccess context, are implicitly prefixed with '*/' to avoid matching partial directory names.

    @@ -666,8 +666,8 @@ indexingFoldersFirst is enabled, subdirectory Zed will be listed before subdirectory Beta, which will be listed before normal files - Gamma and Alpha. - This option only has an effect if Gamma and Alpha. + This option only has an effect if FancyIndexing is also enabled. @@ -698,7 +698,7 @@ indexing to wait until all the images have been loaded. If no value is given for the option, it defaults to the standard height of the icons supplied with the Apache httpd software. - + This option only has an effect if FancyIndexing is also enabled. @@ -793,7 +793,7 @@ indexing description. See also the DescriptionWidth index option to limit the size of the description column. - + This option only has an effect if FancyIndexing is also enabled. @@ -834,7 +834,7 @@ indexing
    This will suppress the display of the last modification date, in fancy indexing listings. - + This option only has an effect if FancyIndexing is also enabled. @@ -850,7 +850,7 @@ indexing by the final specification prohibits img and hr elements from the pre block (used to format FancyIndexed listings.) - + This option only has an effect if FancyIndexing is also enabled. @@ -861,7 +861,7 @@ indexing id="indexoptions.suppresssize">SuppressSize
    This will suppress the file size in fancy indexing listings. - + This option only has an effect if FancyIndexing is also enabled. @@ -1058,7 +1058,7 @@ Name|Date|Size|Description following classes are associated with the various parts of the listing:

    -
    +
    diff --git a/docs/manual/mod/mod_cache.html.en b/docs/manual/mod/mod_cache.html.en index 5440db4af0..71a1122396 100644 --- a/docs/manual/mod/mod_cache.html.en +++ b/docs/manual/mod/mod_cache.html.en @@ -181,7 +181,7 @@ LoadModule cache_module modules/mod_cache.so 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/ </IfModule> @@ -473,7 +473,7 @@ manager <LocationMatch> sections are processed before globally defined CacheEnable directives.

    -

    When acting as a forward proxy server, url-string must +

    When acting as a forward proxy server, url-string must minimally begin with a protocol for which caching should be enabled.

    # Cache content (normal handler only)
    @@ -570,7 +570,7 @@ CacheHeader on
    CacheIgnoreCacheControl directive allows this behavior to be overridden. CacheIgnoreCacheControl On tells the server to attempt to serve the resource from the cache even - if the request contains no-cache header values.

    + if the request contains no-cache header values.

    CacheIgnoreCacheControl On
    @@ -842,7 +842,7 @@ CacheLock on
    ClassDefinition
    tr.indexheadHeader row of listing
    th.indexcolicon and td.indexcolicon Icon column

    The CacheLockPath directive allows you to specify the directory in which the locks are created. If directory is not an absolute - path, the location specified will be relative to the value of + path, the location specified will be relative to the value of DefaultRuntimeDir.

    diff --git a/docs/manual/mod/mod_cache.xml b/docs/manual/mod/mod_cache.xml index e6bf98bf11..8afde7fc0d 100644 --- a/docs/manual/mod/mod_cache.xml +++ b/docs/manual/mod/mod_cache.xml @@ -162,7 +162,7 @@ LoadModule cache_module modules/mod_cache.so 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/ </IfModule> @@ -374,7 +374,7 @@ manager LocationMatch sections are processed before globally defined CacheEnable directives.

    -

    When acting as a forward proxy server, url-string must +

    When acting as a forward proxy server, url-string must minimally begin with a protocol for which caching should be enabled.

    @@ -570,7 +570,7 @@ header. CacheIgnoreCacheControl directive allows this behavior to be overridden. CacheIgnoreCacheControl On tells the server to attempt to serve the resource from the cache even - if the request contains no-cache header values.

    + if the request contains no-cache header values.

    CacheIgnoreCacheControl On @@ -877,7 +877,7 @@ CacheLock on

    The CacheLockPath directive allows you to specify the directory in which the locks are created. If directory is not an absolute - path, the location specified will be relative to the value of + path, the location specified will be relative to the value of DefaultRuntimeDir.

    diff --git a/docs/manual/mod/mod_cern_meta.html.fr b/docs/manual/mod/mod_cern_meta.html.fr index 12847614d8..6d698a54c1 100644 --- a/docs/manual/mod/mod_cern_meta.html.fr +++ b/docs/manual/mod/mod_cern_meta.html.fr @@ -28,6 +28,8 @@  fr  |  ko 

    +
    Cette traduction peut être périmée. Vérifiez la version + anglaise pour les changements récents.
    diff --git a/docs/manual/mod/mod_cern_meta.xml.fr b/docs/manual/mod/mod_cern_meta.xml.fr index e52b0df00d..d360901961 100644 --- a/docs/manual/mod/mod_cern_meta.xml.fr +++ b/docs/manual/mod/mod_cern_meta.xml.fr @@ -1,7 +1,7 @@ - + diff --git a/docs/manual/mod/mod_cern_meta.xml.ko b/docs/manual/mod/mod_cern_meta.xml.ko index 16bd7d801e..096cc749a7 100644 --- a/docs/manual/mod/mod_cern_meta.xml.ko +++ b/docs/manual/mod/mod_cern_meta.xml.ko @@ -1,7 +1,7 @@ - + + diff --git a/docs/manual/mod/mod_deflate.xml.ja b/docs/manual/mod/mod_deflate.xml.ja index b6480babaf..65bba7d667 100644 --- a/docs/manual/mod/mod_deflate.xml.ja +++ b/docs/manual/mod/mod_deflate.xml.ja @@ -1,7 +1,7 @@ - + + + @@ -1662,8 +1662,8 @@ end All

    - This directive provides a hook for the type_checker phase of the request processing. - This phase is where requests are assigned a content type and a handler, and thus can + This directive provides a hook for the type_checker phase of the request processing. + This phase is where requests are assigned a content type and a handler, and thus can be used to modify the type and handler based on input:

    @@ -1730,7 +1730,7 @@ function authcheck_hook(r) return apache2.OK end - Ordering

    The optional arguments "early" or "late" + Ordering

    The optional arguments "early" or "late" control when this script runs relative to other modules.

    @@ -1747,7 +1747,7 @@ end

    Add your hook to the access_checker phase. An access checker hook function usually returns OK, DECLINED, or HTTP_FORBIDDEN.

    - Ordering

    The optional arguments "early" or "late" + Ordering

    The optional arguments "early" or "late" control when this script runs relative to other modules.

    @@ -1778,7 +1778,7 @@ hook function usually returns OK, DECLINED, or HTTP_FORBIDDEN.

    more specific section are run after those defined in the more generic section (LuaInherit parent-first). You can reverse this order, or make the parent context not apply at all.

    - +

    In previous 2.3.x releases, the default was effectively to ignore LuaHook* directives from parent configuration sections.

    @@ -1792,12 +1792,12 @@ hook function usually returns OK, DECLINED, or HTTP_FORBIDDEN.

    All

    - This phase is run immediately after the request has been mapped to a virtal host, - and can be used to either do some request processing before the other phases kick - in, or to serve a request without the need to translate, map to storage et cetera. + This phase is run immediately after the request has been mapped to a virtal host, + and can be used to either do some request processing before the other phases kick + in, or to serve a request without the need to translate, map to storage et cetera. As this phase is run before anything else, directives such as Location or Directory are void in this phase, just as + type="section" module="core">Directory are void in this phase, just as URIs have not been properly parsed yet.

    Context

    This directive is not valid in 2.4.5 and later -

    Provides a means of adding a Lua function as an input filter. -As with output filters, input filters work as coroutines, -first yielding before buffers are sent, then yielding whenever -a bucket needs to be passed down the chain, and finally (optionally) -yielding anything that needs to be appended to the input data. The -global variable bucket holds the buckets as they are passed +

    Provides a means of adding a Lua function as an input filter. +As with output filters, input filters work as coroutines, +first yielding before buffers are sent, then yielding whenever +a bucket needs to be passed down the chain, and finally (optionally) +yielding anything that needs to be appended to the input data. The +global variable bucket holds the buckets as they are passed onto the Lua script:

    @@ -1890,7 +1890,7 @@ function input_filter(r) end

    -See "Modifying contents with Lua +See "Modifying contents with Lua filters" for more information.

    @@ -1904,12 +1904,12 @@ filters" for more information. 2.4.5 and later -

    Provides a means of adding a Lua function as an output filter. -As with input filters, output filters work as coroutines, -first yielding before buffers are sent, then yielding whenever -a bucket needs to be passed down the chain, and finally (optionally) -yielding anything that needs to be appended to the input data. The -global variable bucket holds the buckets as they are passed +

    Provides a means of adding a Lua function as an output filter. +As with input filters, output filters work as coroutines, +first yielding before buffers are sent, then yielding whenever +a bucket needs to be passed down the chain, and finally (optionally) +yielding anything that needs to be appended to the input data. The +global variable bucket holds the buckets as they are passed onto the Lua script:

    @@ -1934,7 +1934,7 @@ function output_filter(r) end

    -As with the input filter, the output filter supports denying/skipping a filter +As with the input filter, the output filter supports denying/skipping a filter if it is deemed unwanted:

    @@ -1947,13 +1947,13 @@ function output_filter(r) end Lua filters with <module>mod_filter</module> -

    When a Lua filter is used as the underlying provider via the -FilterProvider directive, filtering +

    When a Lua filter is used as the underlying provider via the +FilterProvider directive, filtering will only work when the filter-name is identical to the provider-name.

    -See "Modifying contents with Lua filters" for more +See "Modifying contents with Lua filters" for more information.

    diff --git a/docs/manual/mod/mod_macro.html.en b/docs/manual/mod/mod_macro.html.en index 00e2792a8b..e184ba4e87 100644 --- a/docs/manual/mod/mod_macro.html.en +++ b/docs/manual/mod/mod_macro.html.en @@ -107,7 +107,7 @@ Examples section.

    Parameter names should begin with a sigil such as $, %, or @, so that they are clearly identifiable, and also in order to help deal with interactions with -other directives, such as the core Define directive. Failure to do so will +other directives, such as the core Define directive. Failure to do so will result in a warning. Nevertheless, you are encouraged to have a good knowledge of your entire server configuration in order to avoid reusing the same variables in different scopes, which can cause confusion.

    diff --git a/docs/manual/mod/mod_macro.xml b/docs/manual/mod/mod_macro.xml index 00829cd2b7..471b7c1d4f 100644 --- a/docs/manual/mod/mod_macro.xml +++ b/docs/manual/mod/mod_macro.xml @@ -95,7 +95,7 @@ Examples section.

    %, or @, so that they are clearly identifiable, and also in order to help deal with interactions with other directives, such as the core Define directive. Failure to do so will +module="core">Define directive. Failure to do so will result in a warning. Nevertheless, you are encouraged to have a good knowledge of your entire server configuration in order to avoid reusing the same variables in different scopes, which can cause confusion.

    diff --git a/docs/manual/mod/mod_mime.xml.ja b/docs/manual/mod/mod_mime.xml.ja index 19012b840c..97985104e1 100644 --- a/docs/manual/mod/mod_mime.xml.ja +++ b/docs/manual/mod/mod_mime.xml.ja @@ -1,7 +1,7 @@ - + + diff --git a/docs/manual/mod/mod_proxy.xml.ja b/docs/manual/mod/mod_proxy.xml.ja index 40705d38a5..8b3b28594f 100644 --- a/docs/manual/mod/mod_proxy.xml.ja +++ b/docs/manual/mod/mod_proxy.xml.ja @@ -1,7 +1,7 @@ - + + + + diff --git a/docs/manual/mod/mod_so.xml.ja b/docs/manual/mod/mod_so.xml.ja index a06dc643da..a2a7b2ce27 100644 --- a/docs/manual/mod/mod_so.xml.ja +++ b/docs/manual/mod/mod_so.xml.ja @@ -1,7 +1,7 @@ - + + + -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 @@ -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] @@ -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.html.en b/docs/manual/rewrite/advanced.html.en index 6aea5414d1..8a723de08d 100644 --- a/docs/manual/rewrite/advanced.html.en +++ b/docs/manual/rewrite/advanced.html.en @@ -93,8 +93,8 @@ http://physical_host_of_user1/u/user/anypath a user has no entry in the map:

    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"
    @@ -125,8 +125,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 @@ -165,8 +165,8 @@ RewriteRule ^(.+)\.html$ /regenerate_page.cgi [PT,L] to accomplish this.

    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:

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

    into the above layout.

    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" @@ -274,10 +274,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 @@ -318,13 +318,13 @@ RewriteRule ^foo\.html$ foo.night.html

    Use the [E] flag to set an environment variable.

    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/advanced.xml b/docs/manual/rewrite/advanced.xml index 7f1b8893d9..8abba8e109 100644 --- a/docs/manual/rewrite/advanced.xml +++ b/docs/manual/rewrite/advanced.xml @@ -101,8 +101,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" @@ -134,8 +134,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 @@ -176,8 +176,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:

    @@ -228,7 +228,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" @@ -287,10 +287,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 @@ -332,14 +332,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/flags.html.en b/docs/manual/rewrite/flags.html.en index e599d1df57..e0f65fc9d5 100644 --- a/docs/manual/rewrite/flags.html.en +++ b/docs/manual/rewrite/flags.html.en @@ -64,7 +64,7 @@ by commas.

    Each flag (with a few exceptions) has a short form, such as -CO, as well as a longer form, such as cookie. +CO, as well as a longer form, such as cookie. While it is most common to use the short form, it is recommended that you familiarize yourself with the long form, so that you remember what each flag is supposed to do. @@ -82,9 +82,9 @@ of how you might use them.

    B (escape backreferences)

    The [B] flag instructs RewriteRule to escape non-alphanumeric characters before applying the transformation.

    -

    In 2.4.10 and later, you can limit the escaping to specific characters -in backreferences by listing them: [B=#?;]. Note: The space -character can be used in the list of characters to escape, but it cannot be +

    In 2.4.10 and later, you can limit the escaping to specific characters +in backreferences by listing them: [B=#?;]. Note: The space +character can be used in the list of characters to escape, but it cannot be the last character in the list.

    mod_rewrite has to unescape URLs before mapping them, @@ -92,7 +92,7 @@ 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 @@ -118,7 +118,7 @@ strings in the encoded form.

    BNP|backrefnoplus (don't escape space to +)

    The [BNP] flag instructs RewriteRule to escape the space character -in a backreference to %20 rather than '+'. Useful when the backreference +in a backreference to %20 rather than '+'. Useful when the backreference will be used in the path component rather than the query string.

    top
    @@ -186,7 +186,7 @@ browsers that support this feature.

    Consider this example:

    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. @@ -272,15 +272,15 @@ value of '1' if the requested URI is an image file. Then, that 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 SetEnvIf. This technique is offered as an example, not as a recommendation.

    top
    -

    END

    +

    END

    Using the [END] flag terminates not only the current round of rewrite processing (like [L]) but also prevents any subsequent rewrite processing from occurring in per-directory (htaccess) context.

    @@ -298,7 +298,7 @@ allows more flexibility in assigning a Forbidden status.

    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 @@ -318,7 +318,7 @@ 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 @@ -331,7 +331,7 @@ 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]

    @@ -344,7 +344,7 @@ For example, the following snippet used in per-server context allows .php files to be displayed by mod_php 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 @@ -392,9 +392,9 @@ redirects.

    argument to index.php, however, the RewriteCond ensures that if the request 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]
    top
    @@ -410,7 +410,7 @@ 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 @@ -418,12 +418,12 @@ pattern still matches (i.e., while the URI still contains an A with a B).

    In 2.5.0 and later, this module returns an error after 10,000 iterations to -protect against unintended looping. An alternative maximum number of +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=32000]
    +RewriteRule "(.+)[><;]$" "$1" [N=32000]
     # ... or, give up if after 10 loops
    -RewriteRule (.+)[><;]$ $1 [N=10]
    +RewriteRule "(.+)[><;]$" "$1" [N=10]
    top
    @@ -438,7 +438,7 @@ 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]
    top
    @@ -448,7 +448,7 @@ example.

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

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

    @@ -490,7 +490,7 @@ 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 @@ -548,7 +548,7 @@ use the [PT] flag to ensure that the

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

    @@ -578,7 +578,7 @@ 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 @@ -625,7 +625,7 @@ will be used to generate the URL sent with the redirect. Any valid HTTP response status code may be specified, using the syntax [R=305], with a 302 status code being used by default if none is specified. The status code specified need not -necessarily be a redirect (3xx) status code. However, +necessarily be a redirect (3xx) status code. However, if a status code is outside the redirect range (300-399) then the substitution string is dropped entirely, and rewriting is stopped as if the L were used.

    @@ -645,24 +645,24 @@ URI in request' warnings.
    top

    S|skip

    -

    The [S] flag is used to skip rules that you don't want to run. The -syntax of the skip flag is [S=N], where N signifies +

    The [S] flag is used to skip rules that you don't want to run. The +syntax of the skip flag is [S=N], where N signifies the number of rules to skip (provided the RewriteRule and any preceding -RewriteCond directives match). This can be thought of as a -goto statement in your rewrite ruleset. In the following +RewriteCond directives match). This can be thought of as a +goto statement in your rewrite ruleset. In the following example, we only want to run the -RewriteRule if the requested URI doesn't correspond with an +RewriteRule if the 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 RewriteCond only applies to the @@ -674,18 +674,18 @@ use this to make pseudo if-then-else constructs: The last rule of the then-clause becomes 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
    @@ -702,7 +702,7 @@ sent. This has the same effect as the # 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 @@ -710,7 +710,7 @@ file extensions, you could force those images to be served with the 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/flags.xml b/docs/manual/rewrite/flags.xml index b12cad3d3b..b3bccb2584 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -81,7 +81,7 @@ 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 @@ -180,7 +180,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. @@ -267,8 +267,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 downloaded from your server.

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

    This example uses the "-" syntax for the rewrite target, which means @@ -316,7 +316,7 @@ longer available.

    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 @@ -330,7 +330,7 @@ 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]

    @@ -344,7 +344,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 @@ -397,9 +397,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] @@ -416,7 +416,7 @@ 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 @@ -428,9 +428,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=32000] +RewriteRule "(.+)[><;]$" "$1" [N=32000] # ... or, give up if after 10 loops -RewriteRule (.+)[><;]$ $1 [N=10] +RewriteRule "(.+)[><;]$" "$1" [N=10] @@ -447,7 +447,7 @@ to your dedicated image server. The match is case-insensitive, so that example.

    -RewriteRule (.*\.(jpg|gif|png))$ http://images.example.com$1 [P,NC] +RewriteRule "(.*\.(jpg|gif|png))$" "http://images.example.com$1" [P,NC] @@ -458,7 +458,7 @@ equivalent. Using the [NE] flag prevents that from happening.

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

    @@ -501,7 +501,7 @@ 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 @@ -566,7 +566,7 @@ use the [PT] flag to ensure that the Alias "/icons" "/usr/local/apache/icons" -RewriteRule /pics/(.+)\.jpg$ /icons/$1.gif [PT] +RewriteRule "/pics/(.+)\.jpg$" "/icons/$1.gif" [PT]

    @@ -597,7 +597,7 @@ 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 @@ -677,13 +677,13 @@ 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 @@ -729,7 +729,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 @@ -738,7 +738,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/flags.xml.fr b/docs/manual/rewrite/flags.xml.fr index b7a5457047..6144a16c7c 100644 --- a/docs/manual/rewrite/flags.xml.fr +++ b/docs/manual/rewrite/flags.xml.fr @@ -1,7 +1,7 @@ - + diff --git a/docs/manual/rewrite/index.xml b/docs/manual/rewrite/index.xml index 548d88cc1b..181e05df96 100644 --- a/docs/manual/rewrite/index.xml +++ b/docs/manual/rewrite/index.xml @@ -87,5 +87,3 @@ wiki - - diff --git a/docs/manual/rewrite/intro.html.en b/docs/manual/rewrite/intro.html.en index 915d8e17ad..6a293058d3 100644 --- a/docs/manual/rewrite/intro.html.en +++ b/docs/manual/rewrite/intro.html.en @@ -141,21 +141,21 @@ the expression.

    CondPattern, back-references are internally created which can be used with the strings $N and %N (see below). These are available for creating - the Substitution parameter of a + the Substitution parameter of a RewriteRule or - the TestString parameter of a + the TestString parameter of a RewriteCond.

    -

    Captures in the RewriteRule patterns are (counterintuitively) available to - all preceding +

    Captures in the RewriteRule patterns are (counterintuitively) available to + all preceding RewriteCond directives, because the RewriteRule expression is evaluated before the individual conditions.

    -

    Figure 1 shows to which - locations the back-references are transferred for expansion as - well as illustrating the flow of the RewriteRule, RewriteCond - matching. In the next chapters, we will be exploring how to use - these back-references, so do not fret if it seems a bit alien +

    Figure 1 shows to which + locations the back-references are transferred for expansion as + well as illustrating the flow of the RewriteRule, RewriteCond + matching. In the next chapters, we will be exploring how to use + these back-references, so do not fret if it seems a bit alien to you at first.

    @@ -177,12 +177,12 @@ of three arguments separated by spaces. The arguments are

  • [flags]: options affecting the rewritten request.
  • -

    The Pattern is a regular expression. -It is initially (for the first rewrite rule or until a substitution occurs) -matched against the URL-path of the incoming request (the part after the -hostname but before any question mark indicating the beginning of a query -string) or, in per-directory context, against the request's path relative -to the directory for which the rule is defined. Once a substitution has +

    The Pattern is a regular expression. +It is initially (for the first rewrite rule or until a substitution occurs) +matched against the URL-path of the incoming request (the part after the +hostname but before any question mark indicating the beginning of a query +string) or, in per-directory context, against the request's path relative +to the directory for which the rule is defined. Once a substitution has occurred, the rules that follow are matched against the substituted value.

    @@ -198,7 +198,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.

    @@ -206,7 +206,7 @@ like the Alias
    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 @@ -216,7 +216,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.

    @@ -225,7 +225,7 @@ path /usr/local/apache2/htdocs/bar.

    The Substitution can also 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 @@ -247,7 +247,7 @@ application of one or more flags to the end of the rule. For example, the 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 @@ -272,8 +272,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 @@ -283,9 +283,9 @@ the Rewrit 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".

    @@ -296,8 +296,8 @@ the
    Rewrit 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/intro.xml b/docs/manual/rewrite/intro.xml index 798bd00e93..52cdb3dcc9 100644 --- a/docs/manual/rewrite/intro.xml +++ b/docs/manual/rewrite/intro.xml @@ -145,22 +145,22 @@ the expression.

    CondPattern, back-references are internally created which can be used with the strings $N and %N (see below). These are available for creating - the Substitution parameter of a + the Substitution parameter of a RewriteRule or - the TestString parameter of a + the TestString parameter of a RewriteCond.

    Captures in the RewriteRule patterns are (counterintuitively) available to - all preceding + >RewriteRule patterns are (counterintuitively) available to + all preceding RewriteCond directives, because the RewriteRule expression is evaluated before the individual conditions.

    -

    Figure 1 shows to which - locations the back-references are transferred for expansion as - well as illustrating the flow of the RewriteRule, RewriteCond - matching. In the next chapters, we will be exploring how to use - these back-references, so do not fret if it seems a bit alien +

    Figure 1 shows to which + locations the back-references are transferred for expansion as + well as illustrating the flow of the RewriteRule, RewriteCond + matching. In the next chapters, we will be exploring how to use + these back-references, so do not fret if it seems a bit alien to you at first.

    @@ -183,12 +183,12 @@ of three arguments separated by spaces. The arguments are

  • [flags]: options affecting the rewritten request.
  • -

    The Pattern is a regular expression. -It is initially (for the first rewrite rule or until a substitution occurs) -matched against the URL-path of the incoming request (the part after the -hostname but before any question mark indicating the beginning of a query -string) or, in per-directory context, against the request's path relative -to the directory for which the rule is defined. Once a substitution has +

    The Pattern is a regular expression. +It is initially (for the first rewrite rule or until a substitution occurs) +matched against the URL-path of the incoming request (the part after the +hostname but before any question mark indicating the beginning of a query +string) or, in per-directory context, against the request's path relative +to the directory for which the rule is defined. Once a substitution has occurred, the rules that follow are matched against the substituted value.

    @@ -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 @@ -354,5 +354,3 @@ the RewriteRule. In addition, the - - diff --git a/docs/manual/rewrite/proxy.html.en b/docs/manual/rewrite/proxy.html.en index 6c7e08d009..fca4afcf0d 100644 --- a/docs/manual/rewrite/proxy.html.en +++ b/docs/manual/rewrite/proxy.html.en @@ -57,8 +57,8 @@ A number of recipes are provided that describe common scenarios.

    follows:

    RewriteEngine  on
    -RewriteBase    /products/
    -RewriteRule    ^widget/(.*)$  http://product.example.com/widget/$1  [P]
    +RewriteBase    "/products/"
    +RewriteRule    "^widget/(.*)$"  "http://product.example.com/widget/$1"  [P]
     ProxyPassReverse "/products/widget/" "http://product.example.com/widget/"
    @@ -67,9 +67,9 @@ ProxyPassReverse "/products/widget/" "http://product.example.com/widget/" from one server to another, and you're not sure if all the content has been migrated yet.

    -
    RewriteCond %{REQUEST_FILENAME}       !-f
    -RewriteCond %{REQUEST_FILENAME}       !-d
    -RewriteRule ^/(.*) http://old.example.com/$1 [P]
    +
    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/proxy.xml b/docs/manual/rewrite/proxy.xml index 448a5e68c5..8a255e891d 100644 --- a/docs/manual/rewrite/proxy.xml +++ b/docs/manual/rewrite/proxy.xml @@ -67,8 +67,8 @@ A number of recipes are provided that describe common scenarios.

    RewriteEngine on -RewriteBase /products/ -RewriteRule ^widget/(.*)$ http://product.example.com/widget/$1 [P] +RewriteBase "/products/" +RewriteRule "^widget/(.*)$" "http://product.example.com/widget/$1" [P] ProxyPassReverse "/products/widget/" "http://product.example.com/widget/" @@ -78,9 +78,9 @@ 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] +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.html.en b/docs/manual/rewrite/remapping.html.en index debd3cdadb..db22af1778 100644 --- a/docs/manual/rewrite/remapping.html.en +++ b/docs/manual/rewrite/remapping.html.en @@ -75,7 +75,7 @@ configuration.
    following rule:

    RewriteEngine  on
    -RewriteRule    ^/foo\.html$  /bar.html [PT]
    +RewriteRule "^/foo\.html$" "/bar.html" [PT] @@ -105,7 +105,7 @@ RewriteRule ^/foo\.html$ /bar.html [PT]

    RewriteEngine  on
    -RewriteRule    ^/foo\.html$  bar.html  [R]
    +RewriteRule "^/foo\.html$" "bar.html" [R] @@ -146,7 +146,7 @@ RewriteRule ^/foo\.html$ bar.html [#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
    @@ -186,8 +186,8 @@ Redirect "/docs/" "http://new.example.com/docs/"
    /~quux/foo.cgi.

    RewriteEngine  on
    -RewriteBase    /~quux/
    -RewriteRule    ^foo\.html$  foo.cgi   [H=cgi-script]
    +RewriteBase "/~quux/" +RewriteRule "^foo\.html$" "foo.cgi" [H=cgi-script] @@ -220,11 +220,11 @@ RewriteRule ^foo\.html$ foo.cgi # when and only when document.php exists <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> @@ -307,16 +307,16 @@ might do the following:

    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]

    @@ -326,9 +326,9 @@ RewriteRule ^/?(.*) http://www.example.com/$1 [L,R,NE] example.com, you could use the following 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 @@ -363,17 +363,17 @@ RewriteRule ^/?(.*) http://www.%{HTTP_HOST}/$1 [L,R,NE] # 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] @@ -404,9 +404,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]

    @@ -461,7 +461,7 @@ com http://www.example.com/
    we replace /puppies and /canines by the canonical /dogs.

    -
    RewriteRule   ^/(puppies|canines)/(.*)    /dogs/$2  [R]
    +
    RewriteRule   "^/(puppies|canines)/(.*)"    "/dogs/$2"  [R]
    @@ -501,7 +501,7 @@ using the following ruleset:

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

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

    @@ -545,18 +545,18 @@ 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
    +  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 @@ -582,14 +582,14 @@ of the URL.

    Many of the solutions in this section will all use the same condition, which leaves the matched value in the %2 backreference. %1 is the beginining of the query string (up to the key of intererest), and %3 is the remainder. This -condition is a bit complex for flexibility and to avoid double '&&' in the +condition is a bit complex for flexibility and to avoid double '&&' in the substitutions.

    • This solution removes the matching key and value:
      # Remove mykey=???
      -RewriteCond %{QUERY_STRING} (.*(?:^|&))mykey=([^&]*)&?(.*)&?$
      -RewriteRule (.*) $1?%1%3
      +RewriteCond "%{QUERY_STRING}" "(.*(?:^|&))mykey=([^&]*)&?(.*)&?$" +RewriteRule "(.*)" "$1?%1%3"
    • @@ -597,25 +597,25 @@ RewriteRule (.*) $1?%1%3 discarding the rest of the original query by appending a '?':
      # 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]
    • This solution checks the captured value in a subsequent condition:
      # 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]
    • This solution shows the reverse of the previous ones, copying path components (perhaps PATH_INFO) from the URL into the query string. -
      # The desired URL might be /products/kitchen-sink, and the script expects 
      +
      # 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/remapping.xml b/docs/manual/rewrite/remapping.xml index d392472a1b..9a9866c770 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] @@ -148,7 +148,7 @@ Redirect "/foo.html" "/bar.html" #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] @@ -191,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] @@ -226,11 +226,11 @@ RewriteRule ^foo\.html$ foo.cgi   [H=cgi-script] # when and only when document.php exists <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> @@ -318,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]

    @@ -339,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 @@ -378,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] @@ -420,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] @@ -478,7 +478,7 @@ com http://www.example.com/
    by the canonical /dogs.

    -RewriteRule ^/(puppies|canines)/(.*) /dogs/$2 [R] +RewriteRule "^/(puppies|canines)/(.*)" "/dogs/$2" [R] @@ -520,7 +520,7 @@ using the following ruleset:

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

    Note that this can also be handled using the <Directory "/var/www/my_blog"> - RewriteBase /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> @@ -581,7 +581,7 @@ set to accomplish the same thing:

    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 @@ -614,8 +614,8 @@ substitutions.

    # Remove mykey=??? -RewriteCond %{QUERY_STRING} (.*(?:^|&))mykey=([^&]*)&?(.*)&?$ -RewriteRule (.*) $1?%1%3 +RewriteCond "%{QUERY_STRING}" "(.*(?:^|&))mykey=([^&]*)&?(.*)&?$" +RewriteRule "(.*)" "$1?%1%3" @@ -624,8 +624,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] @@ -633,9 +633,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] @@ -644,7 +644,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.html.en b/docs/manual/rewrite/rewritemap.html.en index ff5fee698c..c1be7ddc2b 100644 --- a/docs/manual/rewrite/rewritemap.html.en +++ b/docs/manual/rewrite/rewritemap.html.en @@ -64,7 +64,8 @@ configuration.

    The syntax of the RewriteMap directive is as follows:

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

    The MapName is an @@ -89,17 +90,17 @@ configuration.

    For example, you can 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

    @@ -146,8 +147,8 @@ may be used, and give examples of each.

    Redirect a URI to an all-lowercase version of itself

    -
    RewriteMap lc int:tolower
    -RewriteRule (.*?[A-Z]+.*) ${lc:$1} [R]
    +
    RewriteMap lc "int:tolower"
    +RewriteRule "(.*?[A-Z]+.*)" "${lc:$1}" [R]
    @@ -184,8 +185,8 @@ RewriteRule (.*?[A-Z]+.*) ${lc:$1} [R] product IDs for easier-to-remember URLs, using the following 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 @@ -216,7 +217,7 @@ 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]
    @@ -255,10 +256,10 @@ static www1|www2|www3|www4
    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 @@ -290,7 +291,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. @@ -309,7 +310,7 @@ $ httxt2dbm -i mapfile.txt -o mapfile.map

    You can then reference the resulting file in your RewriteMap directive:

    -
    RewriteMap mapname dbm:/etc/apache/mapfile.map
    +
    RewriteMap mapname "dbm:/etc/apache/mapfile.map"
    @@ -364,10 +365,10 @@ by many requests.

    A simple example is shown here which will replace all dashes with underscores in a request URI.

    - +

    Rewrite configuration

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

    dash2under.pl

    diff --git a/docs/manual/rewrite/rewritemap.xml b/docs/manual/rewrite/rewritemap.xml index 0b33e52690..c4e7df590b 100644 --- a/docs/manual/rewrite/rewritemap.xml +++ b/docs/manual/rewrite/rewritemap.xml @@ -87,19 +87,19 @@ RewriteMap MapName MapType:MapSource

    For example, you can 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 @@ -147,8 +147,8 @@ may be used, and give examples of each.

    Redirect a URI to an all-lowercase version of itself

    -RewriteMap lc int:tolower -RewriteRule (.*?[A-Z]+.*) ${lc:$1} [R] +RewriteMap lc "int:tolower" +RewriteRule "(.*?[A-Z]+.*)" "${lc:$1}" [R] @@ -186,8 +186,8 @@ RewriteRule (.*?[A-Z]+.*) ${lc:$1} [R] 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 @@ -219,7 +219,7 @@ telephone 328 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] @@ -258,10 +258,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 @@ -294,7 +294,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. @@ -315,7 +315,7 @@ $ httxt2dbm -i mapfile.txt -o mapfile.map RewriteMap directive:

    -RewriteMap mapname dbm:/etc/apache/mapfile.map +RewriteMap mapname "dbm:/etc/apache/mapfile.map" @@ -374,8 +374,8 @@ by many requests.

    Rewrite configuration

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

    dash2under.pl

    diff --git a/docs/manual/rewrite/tech.html.en b/docs/manual/rewrite/tech.html.en index b743efb377..e8a90490a6 100644 --- a/docs/manual/rewrite/tech.html.en +++ b/docs/manual/rewrite/tech.html.en @@ -77,11 +77,11 @@ and URL matching.

    for /foo/bar/baz is being processed, an expression like ^bar/baz$ would match.

    -

    If a substitution is made in per-directory context, a new internal - subrequest is issued with the new URL, which restarts processing of the - request phases. If the substitution is a relative path, the RewriteBase directive +

    If a substitution is made in per-directory context, a new internal + subrequest is issued with the new URL, which restarts processing of the + request phases. If the substitution is a relative path, the RewriteBase directive determines the URL-path prefix prepended to the substitution. - In per-directory context, care must be taken to + In per-directory context, care must be taken to create rules which will eventually (in some future "round" of per-directory rewrite processing) not perform a substitution to avoid looping. (See RewriteLooping @@ -103,23 +103,23 @@ and URL matching.

    - + - + - +
    Description:La sémantique des métafichiers du serveur httpd du CERN
    Statut:Extension
    VirtualHost sectionRewriteRule ^/images/(.+)\.jpg /images/$1.gifRewriteRule "^/images/(.+)\.jpg" "/images/$1.gif"
    .htaccess file in document rootRewriteRule ^images/(.+)\.jpg images/$1.gifRewriteRule "^images/(.+)\.jpg" "images/$1.gif"
    .htaccess file in images directoryRewriteRule ^(.+)\.jpg $1.gifRewriteRule "^(.+)\.jpg" "$1.gif"

    For even more insight into how mod_rewrite manipulates URLs in - different contexts, you should consult the log entries made during + different contexts, you should consult the log entries made during rewriting.

    top
    diff --git a/docs/manual/rewrite/tech.xml b/docs/manual/rewrite/tech.xml index 83a69f3fc4..e22c7cf8e1 100644 --- a/docs/manual/rewrite/tech.xml +++ b/docs/manual/rewrite/tech.xml @@ -76,7 +76,7 @@ and URL matching.

    In per-directory context (i.e., within .htaccess files and Directory blocks), these rules are being applied after a URL has already been translated to a filename. Because of - this, the URL-path that mod_rewrite initially compares RewriteRule directives against is the full filesystem path to the translated filename with the current directories path (including a trailing slash) removed from the front.

    @@ -85,12 +85,12 @@ and URL matching.

    for /foo/bar/baz is being processed, an expression like ^bar/baz$ would match.

    -

    If a substitution is made in per-directory context, a new internal - subrequest is issued with the new URL, which restarts processing of the - request phases. If the substitution is a relative path, the RewriteBase directive +

    If a substitution is made in per-directory context, a new internal + subrequest is issued with the new URL, which restarts processing of the + request phases. If the substitution is a relative path, the RewriteBase directive determines the URL-path prefix prepended to the substitution. - In per-directory context, care must be taken to + In per-directory context, care must be taken to create rules which will eventually (in some future "round" of per-directory rewrite processing) not perform a substitution to avoid looping. (See RewriteLooping @@ -112,24 +112,24 @@ 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"

    For even more insight into how mod_rewrite manipulates URLs in different contexts, you should consult the log entries made during + href="../mod/mod_rewrite.html#logging">log entries made during rewriting.

    @@ -188,4 +188,3 @@ and URL matching.

    - diff --git a/docs/manual/rewrite/vhosts.html.en b/docs/manual/rewrite/vhosts.html.en index 1946a98d21..8ad14c9eb0 100644 --- a/docs/manual/rewrite/vhosts.html.en +++ b/docs/manual/rewrite/vhosts.html.en @@ -67,10 +67,10 @@ mod_rewrite document.
    RewriteEngine on
     
    -RewriteMap    lowercase int:tolower
    +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
    @@ -137,19 +137,19 @@ CustomLog logs/access_log vcommon RewriteEngine On # a ServerName derived from a Host: header may be any case at all -RewriteMap lowercase int:tolower +RewriteMap lowercase "int:tolower" ## deal with normal documents first: # allow Alias /icons/ to work - repeat for other aliases -RewriteCond %{REQUEST_URI} !^/icons/ +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]
    top
    @@ -175,23 +175,23 @@ customer-N.example.com /www/customers/N
    RewriteEngine on
     
    -RewriteMap   lowercase  int:tolower
    +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/rewrite/vhosts.xml b/docs/manual/rewrite/vhosts.xml index 8a44a85016..1cea3de087 100644 --- a/docs/manual/rewrite/vhosts.xml +++ b/docs/manual/rewrite/vhosts.xml @@ -74,10 +74,10 @@ mod_rewrite document. RewriteEngine on -RewriteMap lowercase int:tolower +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
    @@ -146,19 +146,19 @@ CustomLog logs/access_log vcommon RewriteEngine On # a ServerName derived from a Host: header may be any case at all -RewriteMap lowercase int:tolower +RewriteMap lowercase "int:tolower" ## deal with normal documents first: # allow Alias /icons/ to work - repeat for other aliases -RewriteCond %{REQUEST_URI} !^/icons/ +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]
    @@ -185,23 +185,23 @@ customer-N.example.com /www/customers/N
    RewriteEngine on -RewriteMap lowercase int:tolower +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.html.en b/docs/manual/sections.html.en index 06bf546e87..eaec0d3255 100644 --- a/docs/manual/sections.html.en +++ b/docs/manual/sections.html.en @@ -451,10 +451,10 @@ are interpreted, it is important to understand how this works.

    order.

    Later sections override earlier ones, however each module is responsible - for interpreting what form this override takes. A later configuration section + for interpreting what form this override takes. A later configuration section with directives from a given module might cause a conceptual "merge" of some - directives, all directives, or a complete replacement of the modules - configuration with the module defaults and directives explicitly listed in + directives, all directives, or a complete replacement of the modules + configuration with the module defaults and directives explicitly listed in the later context.

    Technical Note

    diff --git a/docs/manual/sections.xml b/docs/manual/sections.xml index b42f06c52f..f8aa84183b 100644 --- a/docs/manual/sections.xml +++ b/docs/manual/sections.xml @@ -511,10 +511,10 @@ are interpreted, it is important to understand how this works.

    order.

    Later sections override earlier ones, however each module is responsible - for interpreting what form this override takes. A later configuration section + for interpreting what form this override takes. A later configuration section with directives from a given module might cause a conceptual "merge" of some - directives, all directives, or a complete replacement of the modules - configuration with the module defaults and directives explicitly listed in + directives, all directives, or a complete replacement of the modules + configuration with the module defaults and directives explicitly listed in the later context.

    Technical Note diff --git a/docs/manual/sections.xml.fr b/docs/manual/sections.xml.fr index d2176b68ca..11088af6f8 100644 --- a/docs/manual/sections.xml.fr +++ b/docs/manual/sections.xml.fr @@ -3,7 +3,7 @@ - + + + + - + + + + + diff --git a/docs/manual/vhosts/examples.xml.ja b/docs/manual/vhosts/examples.xml.ja index d110e96f42..bc4d48ad13 100644 --- a/docs/manual/vhosts/examples.xml.ja +++ b/docs/manual/vhosts/examples.xml.ja @@ -1,7 +1,7 @@ - + + +