Ik heb een web.config in de root:
En ik heb een subdirectory met daarin een CMS, met ook een web.config file:
De site in de root werkt prima.
Het CMS echter niet. www.domain.com/subdir werkt wel maar als ik een link selecteer in het CMS (vb www.domain.com/subdir/test/1) worden de parameters in de URL opgepikt door de web.config in de root en wordt de CMS URL gebruikt in de hoofdsite in de root. In web.config ontbreekt de rewritebase optie.
Is er een alternatief of truc waarmee ik kan voorkomen dat dit gebeurt?
code:
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
| <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 25" stopProcessing="true">
<match url=".*" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{QUERY_STRING}" pattern="^PHPSESSID=.*$" ignoreCase="false" />
</conditions>
<action type="Redirect" url="{URL}?" appendQueryString="false" redirectType="Permanent" />
</rule>
<rule name="Imported Rule 26">
<match url="^$" ignoreCase="false" />
<action type="Rewrite" url="index.php" />
</rule>
<rule name="Imported Rule 27">
<match url="^$" ignoreCase="false" />
<action type="Rewrite" url="index.php" />
</rule>
<rule name="Imported Rule 28" stopProcessing="true">
<match url=".*" ignoreCase="false" />
<conditions logicalGrouping="MatchAny">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
</conditions>
<action type="None" />
</rule>
<rule name="Imported Rule 29" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}&idd={R:3}&iddd={R:4}&idddd={R:5}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 30" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}&idd={R:3}&iddd={R:4}&idddd={R:5}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 31" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}&idd={R:3}&iddd={R:4}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 32" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}&idd={R:3}&iddd={R:4}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 33" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}&idd={R:3}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 34" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)/([A-Za-z0-9-]+)/?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}&idd={R:3}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 35" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 36" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)/?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 37" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 38" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}" appendQueryString="true" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration> |
En ik heb een subdirectory met daarin een CMS, met ook een web.config file:
code:
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
| <?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 13" stopProcessing="true">
<match url=".*" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{QUERY_STRING}" pattern="^PHPSESSID=.*$" ignoreCase="false" />
</conditions>
<action type="Redirect" url="{URL}?" appendQueryString="false" redirectType="Permanent" />
</rule>
<rule name="Imported Rule 14">
<match url="^$" ignoreCase="false" />
<action type="Rewrite" url="index.php" />
</rule>
<rule name="Imported Rule 15">
<match url="^$" ignoreCase="false" />
<action type="Rewrite" url="index.php" />
</rule>
<rule name="Imported Rule 16" stopProcessing="true">
<match url=".*" ignoreCase="false" />
<conditions logicalGrouping="MatchAny">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />
</conditions>
<action type="None" />
</rule>
<rule name="Imported Rule 17" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 18" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 19" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 20" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)/?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 21" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)/(.*).html?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 22" stopProcessing="true">
<match url="^([A-Za-z0-9-]*)/([A-Za-z0-9-]+)/(.*).html/?$" ignoreCase="false" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}" appendQueryString="true" />
</rule>
<rule name="Imported Rule 23" stopProcessing="true">
<match url="^([a-z]*)/([A-Za-z0-9]+)/([A-Za-z0-9]+)?$" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}&action={R:3}" appendQueryString="false" />
</rule>
<rule name="Imported Rule 24" stopProcessing="true">
<match url="^([a-z]*)/([A-Za-z0-9]+)/([A-Za-z0-9]+)/?$" />
<action type="Rewrite" url="index.php?object={R:1}&id={R:2}&action={R:3}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration> |
De site in de root werkt prima.
Het CMS echter niet. www.domain.com/subdir werkt wel maar als ik een link selecteer in het CMS (vb www.domain.com/subdir/test/1) worden de parameters in de URL opgepikt door de web.config in de root en wordt de CMS URL gebruikt in de hoofdsite in de root. In web.config ontbreekt de rewritebase optie.
Is er een alternatief of truc waarmee ik kan voorkomen dat dit gebeurt?