Bonjour,

Nous mettons en place l'URL rewriting sur notre boutique en ligne en utilisant le module URLRewriter.dll

Pour ce faire nous disposons dans le web.config des concordances d'adresses, du type :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
<!-- CATEGORIE + FILTRE1 + FILTRE2 -->
<RewriterRule>
    <LookFor>categorie1.(val1|val2|val3|val4).(val5|val6|val7|val8)\..+</LookFor>
    <SendTo>produits.aspx?id=1&amp;f1=$1&amp;f2=$2</SendTo>
</RewriterRule>
<RewriterRule>
    <LookFor>categorie2.(val1|val2|val3|val4).(val5|val6|val7|val8)\..+</LookFor>
    <SendTo>produits.aspx?id=2&amp;f1=$1&amp;f2=$2</SendTo>
</RewriterRule>
 
<!-- CATEGORIE + FILTRE1 -->
<RewriterRule>
    <LookFor>categorie1.(val1|val2|val3|val4)\..+</LookFor>
    <SendTo>produits.aspx?id=1&amp;f1=$1&amp;</SendTo>
</RewriterRule>
<RewriterRule>
    <LookFor>categorie2.(val1|val2|val3|val4)..+</LookFor>
    <SendTo>produits.aspx?id=2&amp;f1=$1&amp;</SendTo>
</RewriterRule>
 
<!-- CATEGORIE + FILTRE2 -->
<RewriterRule>
    <LookFor>categorie1.(val5|val6|val7|val8)\..+</LookFor>
    <SendTo>produits.aspx?id=1&amp;f2=$1&amp;</SendTo>
</RewriterRule>
<RewriterRule>
    <LookFor>categorie2.(val5|val6|val7|val8)..+</LookFor>
    <SendTo>produits.aspx?id=2&amp;f2=$1&amp;</SendTo>
</RewriterRule>
 
<!-- CATEGORIE -->
<RewriterRule>
    <LookFor>categorie1\..+</LookFor>
    <SendTo>produits.aspx?id=1</SendTo>
</RewriterRule>
<RewriterRule>
    <LookFor>categorie2\..+</LookFor>
    <SendTo>produits.aspx?id=2</SendTo>
</RewriterRule>
Est-il possible de simplifier les expressions régulières pour éviter de quadrupler les URLs ? Notre fichier web.config devient un vrai catalogue de la Redoute...