Created
June 24, 2021 23:45
-
-
Save MahdiKarimipour/0c11f0e5fc8139abeb8eddf5ec72ba34 to your computer and use it in GitHub Desktop.
Url Rewrite Configuration With Web.Config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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=".\AssemblyName.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="^NewDomain\.com$" /> | |
</conditions> | |
<action type="Redirect" url="https://NewDomain.com/{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