How to block/allow subpages or strings in the URL using Wildcards.
9148
Created On 09/12/22 12:41 PM - Last Modified 02/15/24 23:53 PM
Objective
- Customers want to block any website that contains a certain text/subpage using a wildcard in URL filtering.
Environment
- Palo Alto Firewalls
- Supported PAN-OS
- URL Filtering
Procedure
This is explained by using an example website http://example.com/aaa/bbb.html.
- The user wants to allow a website if it contains a certain string bbb.html.
- The website contains two layers of subpages. The first part of the page will be denoted by an asterisk (*) followed by the caret (^) to successfully allow/block the website with the string.
- For example, */^/bbb.html will block the page http://example.com/aaa/bbb.html as it contains one subpage (/aaa) after the website URL followed by the subpage (/bbb.html) we need to allow/block.
- If there are more layers of subpages in the URL, add "^/" to the category, for example, "*/^/^/bbb.html" will block "http://example.com/aaa/ccc/bbb.html"
- Asterisks match a greater range of URLs than carets. An asterisk corresponds to any number of consecutive tokens, while a caret corresponds to exactly one token. So, for every additional subpage, an additional caret (^) needs to be added.
Additional Information
- Do not create an entry with consecutive asterisks (*) or more than nine consecutive carets (^)—entries like these can affect firewall performance.