<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<!-- Redirect if path starts with double slashes -->
<rule name="RedirectLeadingDoubleSlashes" stopProcessing="true">
<match url="^(//+)(.*)" />
<conditions>
<!-- Skip redirect if Radware WAF handled it -->
<add input="{HTTP_X_RADWARE_WAF}" pattern=".*" negate="true" />
</conditions>
<action type="Redirect" url="https://{HTTP_HOST}/{R:2}" redirectType="Permanent" />
</rule>
<!-- Angular rewrite fallback for all other routes -->
<rule name="Angular Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/index.html" />
</rule>
</rules>
</rewrite>
<staticContent>
<mimeMap fileExtension=".json" mimeType="application/json" />
</staticContent>
</system.webServer>
</configuration>
Steps:
Open IIS Manager.
Select your website.
Click on Logging.
Click "Select Fields...".
Click Add Field:
Field Name: X-Radware-WAF
Source Type: Request Header
Source: X-Radware-WAF
Save and apply
No comments:
Post a Comment