IIS rewrites

Pagina: 1
Acties:

Onderwerpen


Acties:
  • 0 Henk 'm!

  • mro95
  • Registratie: Januari 2011
  • Laatst online: 22-02 22:03
Hallo tweakers,

Momenteel ben nu nu bezig met het bouwen van een CMS
Nu wil ik de rewrites in iis goed zetten alleen lukt me dat niet helemaal goed omdat: ik 2 mappen wil rewriten. hier is even een korte uitleg.

voobeeld cms:
www.website.nl/news/read/3627
moet te rewrite worden naar
www.website.nl/index.php/news/read/3627

Dat wil nog wel lukken maar nu het admin gedeelte die in de zelfde map staat.

voorbeeld admin cms:
www.website.nl/admin/users/edit/mro95
moet te rewrite worden naar
www.website.nl/admin/index.php/users/edit/mro95

nu heb ik volgende code in web.config gezet
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
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rewriteMaps>
        <rewriteMap name="/" />
                <rewriteMap name="/admin" />
            </rewriteMaps>
            <rules>
                <rule name="Imported Rule 1" stopProcessing="true">
                    <match url="^/(.*)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:0}" />
                </rule>
                <rule name="Imported Rule 2" stopProcessing="true">
                    <match url="^admin/(.*)" ignoreCase="false" />
                    <action type="Rewrite" url="admin/index.php/{R:1}" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>


Maar ook dit werkt helaas niet, t is altijd of de ene of de andere werkt en niet allebei. Kan iemand me hier mee veder helpen?

Vriendelijk groeten,
Maarten - Mro95

Acties:
  • 0 Henk 'm!

  • RobIII
  • Registratie: December 2001
  • Niet online

RobIII

Admin Devschuur®

^ Romeinse Ⅲ ja!

(overleden)

There are only two hard problems in distributed systems: 2. Exactly-once delivery 1. Guaranteed order of messages 2. Exactly-once delivery.

Je eigen tweaker.me redirect

Over mij


Acties:
  • 0 Henk 'm!

  • leon1e
  • Registratie: December 2000
  • Laatst online: 21:47
En als je het zo doet?

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
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1">
                    <match url="^admin/(.*)" ignoreCase="false" />
                    <action type="Rewrite" url="admin/index.php/{R:1}" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:0}" />
        </rule>
                <rule name="Imported Rule 2">
            <match url="^/(.*)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:0}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Acties:
  • 0 Henk 'm!

  • mro95
  • Registratie: Januari 2011
  • Laatst online: 22-02 22:03
leon1e schreef op woensdag 25 januari 2012 @ 12:05:
En als je het zo doet?

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
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="Imported Rule 1">
                    <match url="^admin/(.*)" ignoreCase="false" />
                    <action type="Rewrite" url="admin/index.php/{R:1}" />
                    <conditions>
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:0}" />
        </rule>
                <rule name="Imported Rule 2">
            <match url="^/(.*)" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
                    </conditions>
                    <action type="Rewrite" url="index.php/{R:0}" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>
toon volledige bericht
Nope, Error 500 Internal Server Error.