Utilisation de RewriteMap
Bonjour le forum,
Pour simplifier la lecture de mon fichier de redirection (il s'appelle 'www') sous Apache, j'aimerais utiliser un fichier externe (il s'appelera 'mymap').
Actuellement, j'ai ceci qui fonctionne dans le fichier de redirection 'www':
Code:
1 2 3 4 5 6 7 8 9 10
| RewriteRule ^/path1/word1 http://sub.monsite.com/%{REQUEST_URI} [P]
ProxyPassReverse /path1/word1 http://sub.monsite.com/path1/word1
RewriteRule ^/path1/word1 http://sub.monsite.com/%{REQUEST_URI} [P]
ProxyPassReverse /path1/word1 http://sub.monsite.com/path1/word1
RewriteRule ^/path1/word1 http://sub.monsite.com/%{REQUEST_URI} [P]
ProxyPassReverse /path1/word1 http://sub.monsite.com/path1/word1
etc, etc... |
j'aimerais externaliser toutes ces règles du fichier 'www' et les mettre dans le fichier 'mymap'. Après avoir lu la doc, je n'y comprend pas grand chose à la syntaxe mais ça devrais donner quelque chose ainsi:
dans 'www':
Code:
1 2 3
| RewriteMap themap txt:/path/to/apache/maps/mymap
RewriteCond ${themap:$0} ^.+$
RewriteRule ^(.*)$ ${themap:$0} [R] |
A mon avis, il devrait y avoir 2 variables dans le fichier 'www'? Comment faire cela?
Et comment écrire les règles dans le fichier 'mymap'?
Merci de votre aide.
Skeut