<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1659891:1673563 (outdated) -->
+<!-- English Revision: 1673563 -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<example><title>Exemple simple</title>
<highlight language="config">
AuthFormProvider file
-AuthUserFile conf/passwd
+AuthUserFile "conf/passwd"
AuthType form
AuthName realm
-AuthFormLoginRequiredLocation http://example.com/login.html
+AuthFormLoginRequiredLocation "http://example.com/login.html"
Session On
SessionCookieName session path=/
SessionCryptoPassphrase secret
<example><title>Exemple de configuration du gestionnaire de
formulaire de connexion</title>
<highlight language="config">
-<Location /dologin.html>
+<Location "/dologin.html">
SetHandler form-login-handler
- AuthFormLoginRequiredLocation http://example.com/login.html
- AuthFormLoginSuccessLocation http://example.com/success.html
+ AuthFormLoginRequiredLocation "http://example.com/login.html"
+ AuthFormLoginSuccessLocation "http://example.com/success.html"
AuthFormProvider file
- AuthUserFile conf/passwd
+ AuthUserFile "conf/passwd"
AuthType form
AuthName realm
Session On
<example><title>Exemple simple d'authentification à la volée</title>
<highlight language="config">
AuthFormProvider file
-ErrorDocument 401 /login.shtml
-AuthUserFile conf/passwd
+ErrorDocument 401 "/login.shtml"
+AuthUserFile "conf/passwd"
AuthType form
AuthName realm
-AuthFormLoginRequiredLocation http://example.com/login.html
+AuthFormLoginRequiredLocation "http://example.com/login.html"
Session On
SessionCookieName session path=/
SessionCryptoPassphrase secret
<example><title>Exemple avec script CGI</title>
<highlight language="config">
AuthFormProvider file
- ErrorDocument 401 /cgi-bin/login.cgi
+ ErrorDocument 401 "/cgi-bin/login.cgi"
...
</highlight>
</example>
<highlight language="config">
SetHandler form-logout-handler
AuthName realm
-AuthFormLogoutLocation http://example.com/loggedout.html
+AuthFormLogoutLocation "http://example.com/loggedout.html"
Session On
SessionCookieName session path=/
SessionCryptoPassphrase secret
limitée</title>
<highlight language="config">
SetHandler form-logout-handler
-AuthFormLogoutLocation http://example.com/loggedout.html
+AuthFormLogoutLocation "http://example.com/loggedout.html"
Session On
SessionMaxAge 1
SessionCookieName session path=/
<example><title>Exemple</title>
<highlight language="config">
-<Location /secure>
+<Location "/secure">
AuthType form
AuthName "private area"
AuthFormProvider dbm
AuthDBMType SDBM
- AuthDBMUserFile /www/etc/dbmpasswd
+ AuthDBMUserFile "/www/etc/dbmpasswd"
Require valid-user
#...
</Location>
<example><title>Exemple</title>
<highlight language="config">
-<Location /logout>
+<Location "/logout">
SetHandler form-logout-handler
- AuthFormLogoutLocation http://example.com/loggedout.html
+ AuthFormLogoutLocation "http://example.com/loggedout.html"
Session on
#...
</Location>
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1586470:1673563 (outdated) -->
+<!-- English Revision: 1673563 -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
</p>
<highlight language="config">
# Exemple A: Positionner index.html en page d'index, puis ajouter index.php.
-<Directory /foo>
+<Directory "/foo">
DirectoryIndex index.html
DirectoryIndex index.php
</Directory>
# Exemple B: La même chose que l'exemple A, mais réalisé au moyen d'une seule directive.
-<Directory /foo>
+<Directory "/foo">
DirectoryIndex index.html index.php
</Directory>
# Exemple C: Pour remplacer la liste des ressources, il faut d'abord la vider :
# Ici, seul index.php restera référencé comme ressource d'index.
-<Directory /foo>
+<Directory "/foo">
DirectoryIndex index.html
DirectoryIndex disabled
DirectoryIndex index.php
<highlight language="config">
# voir l'avertissement de sécurité ci-dessous !
-<Location /some/path>
+<Location "/some/path">
DirectorySlash Off
SetHandler some-handler
</Location>
<em>http://example.com/blog/</em>, cet URI intermédiaire doit être
spécifié en tant que <var>url-locale</var> :</p>
<highlight language="config">
-<Directory /web/example.com/htdocs/blog>
+<Directory "/web/example.com/htdocs/blog">
FallbackResource /blog/index.php
</Directory>
-<Directory /web/example.com/htdocs/blog/images>
+<Directory "/web/example.com/htdocs/blog/images">
FallbackResource disabled
</Directory>
</highlight>
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1523325:1673563 (outdated) -->
+<!-- English Revision: 1673563 -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
FilterProvider repack jpeg_pack "%{CONTENT_TYPE} = 'image/jpeg'"
FilterProvider repack gif_pack "%{CONTENT_TYPE} = 'image/gif'"
FilterProvider repack png_pack "%{CONTENT_TYPE} = 'image/png'"
-<Location /image-filter>
+<Location "/image-filter">
FilterChain unpack downsample repack
</Location>
</highlight>
<code>DEFLATE</code>.</p>
<highlight language="config">
-<Location /cgi-bin/>
+<Location "/cgi-bin/">
Options Includes
AddOutputFilterByType INCLUDES;DEFLATE text/html
</Location>
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1577120:1673563 (outdated) -->
+<!-- English Revision: 1673563 -->
<!-- French translation: Fabien Coelho -->
<!-- Updated by Lucien Gentis -->
ServerName $domain
ServerAlias www.$domain
- DocumentRoot /var/www/vhosts/$name
- ErrorLog /var/log/httpd/$name.error_log
- CustomLog /var/log/httpd/$name.access_log combined
+ DocumentRoot "/var/www/vhosts/$name"
+ ErrorLog "/var/log/httpd/$name.error_log"
+ CustomLog "/var/log/httpd/$name.access_log" combined
</VirtualHost>
</Macro>
</highlight>
<highlight language="config">
<Macro DocRoot ${docroot}>
- DocumentRoot /var/www/${docroot}/htdocs
+ DocumentRoot "/var/www/${docroot}/htdocs"
</Macro>
</highlight>
<VirtualHost *:$port>
ServerName $host
- DocumentRoot $dir
+ DocumentRoot "$dir"
# Racine des documents publique
- <Directory $dir>
+ <Directory "$dir">
Require all granted
</Directory>
# restriction d'accès au sous-répertoire intranet.
- <Directory $dir/intranet>
+ <Directory "$dir/intranet">
Require ip 10.0.0.0/8
</Directory>
</VirtualHost>
<highlight language="config">
<Macro DirGroup $dir $group>
- <Directory $dir>
+ <Directory "$dir">
Require group $group
</Directory>
</Macro>
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1649003:1673563 (outdated) -->
+<!-- English Revision: 1673563 -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<example><title>Mandataire inverse simple</title>
<highlight language="config">
- ProxyPass /app ajp://backend.example.com:8009/app
+ ProxyPass "/app ajp://backend.example.com:8009/app"
</highlight>
</example>
<example><title>Mandataire inverse avec répartiteur de charge</title>
<highlight language="config">
<Proxy balancer://cluster>
- BalancerMember ajp://app1.example.com:8009 loadfactor=1
- BalancerMember ajp://app2.example.com:8009 loadfactor=2
+ BalancerMember "ajp://app1.example.com:8009" loadfactor=1
+ BalancerMember "ajp://app2.example.com:8009" loadfactor=2
ProxySet lbmethod=bytraffic
</Proxy>
-ProxyPass /app balancer://cluster/app
+ProxyPass "/app" "balancer://cluster/app"
</highlight>
</example>
; par exemple :</p>
<example><title>Réécriture d'un chemin mandaté</title>
<highlight language="config">
-ProxyPass /apps/foo ajp://backend.example.com:8009/foo
-ProxyPassReverse /apps/foo http://www.example.com/foo
+ProxyPass "/apps/foo" "ajp://backend.example.com:8009/foo"
+ProxyPassReverse "/apps/foo" "http://www.example.com/foo"
</highlight>
</example>
<p>Il est cependant préférable en général de déployer l'application
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1668874:1673563 (outdated) -->
+<!-- English Revision: 1673563 -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<directive>RewriteMap</directive> comme suit </p>
<highlight language="config">
- RewriteMap map-exemple txt:/chemin/vers/fichier/map.txt
+ RewriteMap "map-exemple" "txt:/chemin/vers/fichier/map.txt"
</highlight>
<p>Vous pourrez ensuite utiliser cette table dans une
directive <directive>RewriteRule</directive> comme suit :</p>
<highlight language="config">
- RewriteRule ^/ex/(.*) ${map-exemple:$1}
+ RewriteRule "^/ex/(.*)" "${map-exemple:$1}"
</highlight>
<p>Les combinaisons suivantes pour <em>type de correspondance</em>
"opt" à la racine des documents.</p>
<highlight language="config">
-DocumentRoot /var/www/example.com
-AliasMatch ^/myapp /opt/myapp-1.2.3
-<Directory /opt/myapp-1.2.3>
+DocumentRoot "/var/www/example.com"
+AliasMatch "^/myapp" "/opt/myapp-1.2.3"
+<Directory "/opt/myapp-1.2.3">
RewriteEngine On
RewriteBase /myapp/
- RewriteRule ^index\.html$ welcome.html
+ RewriteRule "^index\.html$" "welcome.html"
</Directory>
</highlight>
<highlight language="config">
RewriteCond expr "! %{HTTP_REFERER} -strmatch '*://%{HTTP_HOST}/*'"<br />
- RewriteRule ^/images - [F]
+ RewriteRule "^/images" "-" [F]
</highlight>
</li>
lieu du AND implicite. Exemple typique :
<highlight language="config">
-RewriteCond %{REMOTE_HOST} ^host1 [OR]
-RewriteCond %{REMOTE_HOST} ^host2 [OR]
-RewriteCond %{REMOTE_HOST} ^host3
+RewriteCond "%{REMOTE_HOST}" "^host1" [OR]
+RewriteCond "%{REMOTE_HOST}" "^host2" [OR]
+RewriteCond "%{REMOTE_HOST}" "^host3"
RewriteRule ...règles concernant tous ces hôtes...
</highlight>
pouvez utiliser ce qui suit : </p>
<highlight language="config">
-RewriteCond %{HTTP_USER_AGENT} (iPhone|Blackberry|Android)
-RewriteRule ^/$ /homepage.mobile.html [L]
+RewriteCond "%{HTTP_USER_AGENT}" "(iPhone|Blackberry|Android)"
+RewriteRule "^/$" "/homepage.mobile.html" [L]
-RewriteRule ^/$ /homepage.std.html [L]
+RewriteRule "^/$" "/homepage.std.html" [L]
</highlight>
<p>Explications : si vous utilisez un navigateur
<a id="regexp" name="regexp">expression rationnelle</a>
compatible perl. Dans la première règle de réécriture,
l'expression est comparée au (%-decoded)
- <a href="./directive-dict.html#Syntax">chemin de l'URL</a> (ou au
- <a href="./directive-dict.html#Syntax">chemin fichier</a>, en
- fonction du contexte) de la
- requête. Les expressions suivantes sont comparées à la sortie de
+ <a href="./directive-dict.html#Syntax">chemin de l'URL</a> de la
+ requête, ou, dans un contexte de répertoire (voir
+ ci-dessous), au chemin de l'URL relativement à ce contexte de
+ répertoire.
+ Les expressions suivantes sont comparées à la sortie de
la dernière règle de réécriture qui
correspondait.</p>
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1334024:1673563 (outdated) -->
+<!-- English Revision: 1673563 -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
SessionCryptoPassphrase secret
SessionCookieName session path=/
AuthFormProvider file
-AuthUserFile conf/passwd
+AuthUserFile "conf/passwd"
AuthType form
AuthName realm
#...
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1634793:1673563 (outdated) -->
+<!-- English Revision: 1673563 -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
<example><title>Exemple</title>
<highlight language="config">
-<Location />
+<Location "/>
AddOutputFilterByType SUBSTITUTE text/html
- Substitute s/foo/bar/ni
+ Substitute "s/foo/bar/ni"
</Location>
</highlight>
</example>
<example><title>Exemple d'utilisation d'un délimiteur
alternatif</title>
<highlight language="config">
-<Location />
+<Location "/">
AddOutputFilterByType SUBSTITUTE text/html
Substitute "s|<BR */?>|<br />|i"
</Location>
substitution, comme illustré dans l'exemple suivant :</p>
<example><title>Exemple d'utilisation de références arrières et de captures</title>
<highlight language="config">
-<Location />
+<Location "/">
AddOutputFilterByType SUBSTITUTE text/html
# "foo=k,bar=k" -> "foo/bar=k"
Substitute "s|foo=(\w+),bar=\1|foo/bar=$1"
<example><title>Réécriture des URLs intégrées à un contenu mandaté</title>
<highlight language="config">
-ProxyPass /blog/ http://internal.blog.example.com
-ProxyPassReverse /blog/ http://internal.blog.example.com/
+ProxyPass "/blog/" "http://internal.blog.example.com"
+ProxyPassReverse "/blog/" "http://internal.blog.example.com/"
Substitute "s|http://internal.blog.example.com/|http://www.example.com/blog/|i"
</highlight>
<example><title>Example</title>
<highlight language="config">
-<Location />
+<Location "/">
AddOutputFilterByType SUBSTITUTE text/html
SubstituteMaxLineLength 10m
- Substitute s/foo/bar/ni
+ Substitute "s/foo/bar/ni"
</Location>
</highlight>
</example>