Skip to main content
Khidzir_MN
Staff
Staff
January 23, 2026

Technical Tip: How to allow access to spesific URL during spesific time period

  • January 23, 2026
  • 0 replies
  • 106 views
Description This article describes how to allow access to spesific URL during spesific time period.
Scope FortiWeb or FortiWeb-VM.
Solution

There is a requirement to allow access to spesific URL during spesific time period.
FortiWeb Custom Policy feature supports Time Period.

 

Example:

Allow access to /payment during 8:00 AM to 5:00 PM daily.

 

Step 1: Go to Web Protection -> Advanced Policy -> Custom Policy: Custom Rule.
Step 2: Create 2 Custom Rules as below the example.

 

before_8am_rule.png

 

CLI commands:

 

config waf custom-access rule
    edit "before_8am"
        set action alert_deny
            config source-ip-filter
            end
            config geo-filter
            end
            config time-range-filter
                edit 1
                    set range_end 07:59 2019/12/31
                next
            end
            config method
            end
            config url-filter
                edit 1
                    set request-file ^/payment.*
                next
            end

 

after_5pm_rule.png

 

CLI commands:

 

config waf custom-access rule
    edit "after_5PM"
        set action alert_deny
            config source-ip-filter
            end
            config geo-filter
            end
            config time-range-filter
                edit 1
                    set range_start 17:00 2019/01/01
                    set range_end 23:59 2019/12/31
                next
            end
            config method
            end
            config url-filter
                edit 1
                    set request-file ^/payment.*
                next
            end


Step 3: Go to Web Protection -> Advanced Policy -> Custom Policy: Custom Policy.
Step 4: Create a Custom Policy and add the 2 Custom Rules created in Step 2.

 

custom_policy.png

CLI commands:

 

config waf custom-access policy
    edit "block_access_outside_8AM_5AM"
        config rule
            edit 1
                set rule-name before_8am
            next
            edit 2
                set rule-name after_5PM
            next
        end
    next
end

 

Step 5: Select the Custom Policy created in Step 4 in the respective Web Protection Profile.

 

wpp.png

 

Related document:

Custom Policy

    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.
    Fortinet Flag the Hack. Wednesday, August 26, 9:00 AM - 5:00 PM ET, COSM, Atlanta, GA.
    Virtual event | September 2026. SASE summit. The age of autonomous trust. Register here!