Skip to main content
kmak
Staff
Staff
April 9, 2025

Technical Tip: How to debug the FortiWeb URL Rewriting module using CLI debug commands in v7.4.x or later

  • April 9, 2025
  • 0 replies
  • 548 views
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
Thought Leadership Security Summit. Outpace New Threats with AI - enhanced defense. Tuesday, Septmeber 15, 8:30 AM - 2:30 PM PT. The Golf Club at Newcastle, WA.
Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!