0

I'm trying to edit my web.config with roadsunknown's code (from this post Remove HTML or ASPX Extension):

<rewrite>
    <rules>
        <rule name="RewriteASPX">
            <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>
    </rules>
</rewrite>

When I add the code I get the following error: Warning 1 The element 'system.web' has invalid child element 'rewrite'.

I have IIS url rewrite 2.0 installed and have executed the script on this blog (http://blog.vanmeeuwen-online.nl/2013/04/visual-studio-2012-xml-intellisense-for.html) to update it for visual studio 2012. I don't know what else to do to get the web.config code to work.

I'd also be interested in an alternative method to remove the .aspx from my site's urls that doesn't involve IIS.

Community
  • 1
  • 1

1 Answers1

0

Not sure about your problem, other than it looks like the module isn't installed. Have you checked the modules section in IIS ?

You could use page routing instead. This describes how to use the page routing mechanism in a webforms app - http://msdn.microsoft.com/en-us/library/vstudio/dd329551(v=vs.100).aspx

sh1rts
  • 1,874
  • 1
  • 13
  • 14