Results 1 to 3 of 3

Thread: Exclude .asp from url rewrite

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Location
    Uk
    Posts
    157

    Question Exclude .asp from url rewrite

    I've installed a new wordpress website

    In order to get friendly links on the website i have added the following code to my web.config - however my existing .aspx page wont post unless i remove it

    When i click the submit button the page reloads

    Any idea how to fix it?

    Code:
        <rewrite>
          <rules>
            <rule name="wordpress" patternSyntax="Wildcard">
              <match url="*" />
              <conditions>
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
              </conditions>
              <action type="Rewrite" url="index.php" />
            </rule>
          </rules>
        </rewrite>
    Last edited by experience; Feb 21st, 2013 at 04:44 PM.

  2. #2

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Location
    Uk
    Posts
    157

    Re: URL Rewrite stops ASP page from posting

    I think i add need to add a 2nd rule to stop .aspx pages from being redirected

    I've tried the following but it doesnt work

    Code:
      <rule name="san aspx">
              <!--Removes the .aspx extension for all pages.-->
              <match url="(.*)" />
              <conditions logicalGrouping="MatchAll">
                <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
                <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
              </conditions>
              <action type="Rewrite" url="{R:1}.aspx" />
            </rule>

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 2009
    Location
    Uk
    Posts
    157

    Re: Exclude .asp from url rewrite

    Have tried dozens of combinations without success :frown:

    I would have thought adding this would have excluded all .aspx pages but i'm not sure why it wont work

    Code:
     <add input="{URL}" negate="true" pattern="\.aspx$" />

Posting Permissions

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



Click Here to Expand Forum to Full Width