mirror of
https://github.com/moudey/Shell.git
synced 2026-11-17 15:05:41 +08:00
65 lines
2.1 KiB
XML
65 lines
2.1 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
<!-- @see https://weblogs.asp.net/scottgu/tip-trick-url-rewriting-with-asp-net -->
|
|
|
|
<configuration>
|
|
|
|
<configSections>
|
|
<section name="rewriter"
|
|
requirePermission="false"
|
|
type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter"/>
|
|
</configSections>
|
|
|
|
<system.web>
|
|
|
|
<httpModules>
|
|
<add name="UrlRewriter"
|
|
type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
|
|
</httpModules>
|
|
|
|
<compilation debug="true"/>
|
|
|
|
</system.web>
|
|
|
|
<system.webServer>
|
|
|
|
<modules runAllManagedModulesForAllRequests="true">
|
|
<add name="UrlRewriter"
|
|
type="Intelligencia.UrlRewriter.RewriterHttpModule"/>
|
|
</modules>
|
|
|
|
<validation validateIntegratedModeConfiguration="false"/>
|
|
|
|
</system.webServer>
|
|
|
|
<rewriter>
|
|
|
|
<!-- Do NOT allow access to the /bin/ directory,
|
|
or anything starting with an underline (_) -->
|
|
<if url="^/(_.*|.*\.vb$|bin($|/))">
|
|
<forbidden/>
|
|
</if>
|
|
|
|
<!-- Remove trailing slash -->
|
|
<redirect url="^(.*)/$" exists="$1" to="$1/" processing="stop"/>
|
|
<redirect url="^(.*)/$" to="$1" processing="stop"/>
|
|
|
|
<!-- Use dynamic pass-through, since /images/docs/* are actually under the projects /docs/images folder -->
|
|
<if url="^/images/docs(/.*)?$">
|
|
<rewrite url="^/images/docs(/.*)?$" to="/Default.aspx?type=image&path=/docs/images$1" processing="stop"/>
|
|
</if>
|
|
|
|
<!-- Do NOT rewrite everything under /assets/ and /images/ -->
|
|
<if url="^/(assets|images)($|/)">
|
|
<rewrite url="^/(.*)" to="~/$1" processing="stop"/>
|
|
</if>
|
|
|
|
<rewrite url="^/Default.aspx$" to="/Default.aspx?path=/" processing="stop"/>
|
|
<rewrite url="~/favicon.ico$" to="~/images/favicon.ico" processing="stop"/>
|
|
|
|
<rewrite url="^(/.*)$" to="/Default.aspx?path=$1" processing="stop"/>
|
|
|
|
</rewriter>
|
|
|
|
</configuration>
|