문제

I did a bit of search but can't find a complete answer to my question: I wonder if it's possible to set my IIS 7.5 to map one "custom" extension to another "physical" extension.

Eg. I have Default.aspx, I'd like my server to serve this file to a request of Default.foo.

The mapping questions/answers I found are all about having Default.foo files, and mapping them to the proper handler; that's not my case, I just like to have a sort of masking of the real physical file extension.

Is it possible?

TY

도움이 되었습니까?

해결책

The mapping should be setup between default.foo and default.aspx, mapping extensions cannot achieve this goal. You may use URL Rewrite module to create a rule to rewrite default.foo to default.aspx.

A simple example is as below,

<rewrite>
        <rules>
            <rule name="foo" stopProcessing="true">
                <match url="(.*)\.foo" />
                <action type="Rewrite" url="{R:1}.aspx" />
            </rule>
        </rules>
    </rewrite>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top