SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: iis url rewrite

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    iis url rewrite

    hi

    I have three pieces of the ASPX page.

    dynamic.aspx?id= dynamic number = 01-canada,02-usa database row

    charge.aspx?id= dynamic number

    number.aspx?id= dynamic number

    x.com/01-canada/charge

    x.com/01-canada/number

    x.com/02-usa/charge

    x.com/02-usa/number

    How do I fix.


    Code:
    <rules>
                    <rule name="Imported Rule 1">
                        <match url="(.*)" ignoreCase="false" />
                        <conditions logicalGrouping="MatchAll">
                            <add input="{URL}" pattern="(.*)" ignoreCase="false" />
                        </conditions>
                        <action type="Rewrite" url="dynamic.aspx?id={R:1}" appendQueryString="false" />
                    </rule>
                  <rule name="Imported Rule 2">
                    <match url="/charge" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                      <add input="{URL}" pattern="/charge" ignoreCase="false" />
                    </conditions>
                    <action type="Rewrite" url="charge.aspx?id={R:1}" appendQueryString="false" />
                  </rule>
                 <rule name="Imported Rule 3">
                    <match url="/number" ignoreCase="false" />
                    <conditions logicalGrouping="MatchAll">
                      <add input="{URL}" pattern="/number" ignoreCase="false" />
                    </conditions>
                    <action type="Rewrite" url="number.aspx?id={R:1}" appendQueryString="false" />
                  </rule>
                </rules>

  2. #2
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    dynamic.aspx?id=1/charge.aspx?id=1
    dynamic.aspx?id=1/number.aspx?id=1

    dynamic.aspx?id=2/charge.aspx?id=2
    dynamic.aspx?id=2/number.aspx?id=2



    folder

    x.com/01-canada/charge

    x.com/01-canada/number

    x.com/02-usa/charge

    x.com/02-usa/number

    .htaccess

  3. #3
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^([a-zA-Z0-9_-]+)$ dynamic.aspx?id=$1 [L]
    RewriteRule ^([a-zA-Z0-9_-]+)/number$ number.aspx?id=$1 [L]
    RewriteRule ^([a-zA-Z0-9_-]+)/charge$ charge.aspx?id=$1 [L]

  4. #4
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Urlwrite

    Hi, I am using Urlwrite attachment on Windows Server IIS7. My web page has 4 phpfile.
    1.index.php
    2.dynamic.php?id=1
    3.charge.php?id=1
    4.number.php?id=1
    I want to Urlwrite directory like this:

    dynamic.aspx?id=1/charge.php?id=1
    dynamic.aspx?id=1/number.php?id=1

    dynamic.aspx?id=2/charge.php?id=2
    dynamic.aspx?id=2/number.php?id=2


    as a file


    x.com/01-canada/charge

    x.com/01-canada/number

    x.com/02-usa/charge

    x.com/02-usa/number

    How can I make this file and directory htaccess or IIS web.config?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •