Missing .aspx in url in IIS 8

I installed a new server with Server 2012 R2 and IIS and published the application on a new site. When I run the application in my development environment, it shows the .aspx extension in the URL, but when I look at the published instance on the IIS server, it removes the .aspx extension.

So, somehow, he has some redrawing of the URLs by turning on this checkbox - how can I change this since I need it to match the development version. I installed the Rewrite URL extension to make sure that some rules were configured somehow, but there are no specific rules.

Thank!

+4
source share
3 answers

, , , , URL- . , , .contains( "pagename" ) .aspx, , . , , URL. , .

0

web.config rewrite (examplePage.aspx) :

<?xml version="1.0"?>
<configuration>
    <system.webServer>
        <rewrite>
            <rules>
                <rule name="examplePage.aspx Redirect" stopProcessing="true">
                    <match url="^(.*\/)*examplePage\.aspx$" />
                    <conditions logicalGrouping="MatchAll">
                        <add input="{REQUEST_METHOD}" negate="true" pattern="^POST$" />
                    </conditions>
                    <action type="Redirect" url="{R:1}" redirectType="Permanent"/>
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

, !

0

I saw this behavior when creating a certain type of web project in development. Thus, it may be something that interferes. I assume you looked at web.config for nothing, but if it is not, try machine.config. Also, look at IIS itself, which is installed when you click on the root level (the one above the site).

0
source

Source: https://habr.com/ru/post/1687219/


All Articles