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>
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>
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$" />