FortiGate
FortiGate Next Generation Firewall utilizes purpose-built security processors and threat intelligence security services from FortiGuard labs to deliver top-rated protection and high performance, including encrypted traffic.
nathan_h
Staff & Editor
Staff & Editor
Article Id 397209
Description

 

This article describes how to determine the URL to block when blocking a specific part of a website. Modern websites use JavaScript to send a HTTP request to the server without reloading the whole page. It will use the API fetch functions or XMLHttpRequest(xhr)/AJAX and can change the content of the website based on the response.

 

Scope

 

FortiGate.

 

Solution

 

Network Topology:

PC -> FortiGate -> Internet.

 

FortiGate Configuration:

 

Web Filter:

 

Web_filter.png

In this example, the URL is www.samsclub.com/c/clothing-shoes-accessories/1959?xid=hdr:shop:more-departments:clothing-shoes-accessories.

 

 Firewall Policy:

 

Firewall_Policy.png

  1. Access the website samsclub.com -> Clothing, Shoes & Accessories. The website will still be accessible.

samsclub_correct.png

 

webiste_still_accessible.png

  1. After reloading the page, the block replacement message is shown. In this scenario, it should be blocked upon selecting 'Clothing, Shoes & Accessories'.

samsclub_blocked.png

  1. Open the browser Developer Tools -> Network. Ensure Preserve Log and Disable cache are checked. Access the website again -> select the Clear icon on the DevTools, then select Fetch/XHR to filter it.

request when clicked.png

  1. Look for the fetch or xhr that triggered when the 'Clothing, Shoes and Accessories' was selected.

select the request.png

 

  1. It is possible to test if this is the actual URL without blocking it yet on FortiGate. Right click -> Block request URL. Access the site again - the specific content of the website will be blocked. Clear all of the blocking after the test.

2025-06-25 08 30 35.png

2025-06-25 08 36 23.png

2025-06-25 08 37 59.png

 

2025-06-25 08 42 34.png

  1. Block the URL with static URL Filter on FortiGate. The specific content of the website should be blocked.

block the url.png

In this case, the URL is: www.samsclub.com/api/node/vivaldi/browse/v2/category/1959.

2025-06-25 08 58 22.png

 

Related article:

Technical Tip: Using a static URL filter feature to allow/block web sites