FortiWeb
A FortiWeb can be configured to join a Security Fabric through the root or downstream FortiGate.
kmak
Staff
Staff
Article Id 386910
Description This article describes how to debug the URL Rewriting module using CLI debug commands in v7.4.x or later.
Scope FortiWeb v7.4 or later.
Solution

Prerequisite:

Server Policy Web Protection Profile has the URL Rewriting module enabled.

 

The FortiWeb URL Rewriting module mostly relies on the HTTP Host and URL regular expression conditions matching.

The FortiWeb GUI traffic log may not be able to identify if the URL rewriting rule and policy match.

Since v7.4.x or later, the CLI debugging has improved and helps better with the URL Rewriting module troubleshooting.

 

To enable debugging for the URL Rewriting module, run the debug commands below:

 

diagnose debug timestamp enable
diagnose debug flow filter client-ip X.X.X.X <----- Replace with test client IP.

diagnose debug flow filter server-ip x.x.x.x <----- Replace with test server VIP IP.
diagnose debug flow filter module url-rewriting 7
diagnose debug flow trace start
diagnose debug enable

 

Send the URL test request.

 

diagnose debug flow trace stop
diagnose debug disable


Sample 1:

URL Rewriting rule that performs redirection of the URI in the root directory to a subdirectory (/public).

 

kmak_0-1744175167025.jpeg

 

Debugging output:

 

kmak_1-1744175167035.jpeg

 

Sample 2:

URL Rewriting rule that performs redirection of the HTTP URL to the HTTPS URL.

 

kmak_2-1744175167040.jpeg

 

Debugging output:

 

kmak_3-1744175167048.jpeg

 

Related documents:

Rewriting & redirecting

Appendix E: Regular expressions