How can i exclude .aspx file from url rewrite ?

experience

New member
Joined
Oct 1, 2009
Messages
2
Programming Experience
Beginner
I've installed a new wordpress website and have added the following code to my web.config to redirect all urls

However it stops my .aspx web page from posting, when i click the submit button it refreshes the page


VB.NET:
<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>

I want to exclude .aspx from the url rewrite, i've tried the adding the following without any success

VB.NET:
    <add input="{REQUEST_FILENAME}" negate="true" pattern="(.*).aspx" />

Any ideas?
 
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

VB.NET:
 <add input="{URL}" negate="true" pattern="\.aspx$" />
 
You can add the exceptions for which you do not want to perform the redirection to HTTPS as extra conditions ,like so:
<rule name="Force HTTPS" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAll">
<add input="{HTTPS}" pattern="off" ignoreCase="true" />
<add input="{REQUEST_URI}" negate="true" pattern="^/noredirect/forthis/page\.aspx$" ignoreCase="true" />
<add input="{REQUEST_URI}" negate="true" pattern="^/noredirect/forthis/page-as-well\.aspx$" ignoreCase="true" />
<add input="{REQUEST_URI}" negate="true" pattern="^/noredirect/forthis/page-as-well-too\.aspx$" ignoreCase="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
 
Back
Top