Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MahdiKarimipour/7c2eca6919e020af67fa148651de2d9b to your computer and use it in GitHub Desktop.
Save MahdiKarimipour/7c2eca6919e020af67fa148651de2d9b to your computer and use it in GitHub Desktop.
Url Rewrite Example using Web.Config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath=".\Home.exe" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="InProcess" />
<rewrite>
<rules>
<rule name="redirect" enabled="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" negate="true" pattern="^technologyleads\.io$" />
</conditions>
<action type="Redirect" url="https://technologyleads.io/{R:1}" appendQueryString="true" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</location>
</configuration>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment