< Home

add referer-host

Function

The add referer-host command adds referer-host rules to a URL filtering profile.

The undo add referer-host command deletes referer-host rules from a URL filtering profile.

Format

add referer-host host-text

undo add referer-host { host-text | all }

Parameters

Parameter Description Value

host-text

Specify a host rule.

The value is a string of 4 to 255 characters, without /, \, #, ", ?, or spaces.

all

Indicates all host rules.

-

Views

URL filtering profile view

Default Level

2: Configuration level

Usage Guidelines

If only the whitelist is configured during the access to a specific web page, other links on the specified web page may fail to be accessed. For example: If only the whitelist rule www.example.com is configured during the access to the www.example.com web page, other links that do not use www.example.com as the domain name are inaccessible. To solve the preceding problem, you can run this command to add the referer-host rule to the URL filtering profile. The referer field in an HTTP request will be matched with the referer-host rule. If a match is found, the URL request is allowed. If the referer field in the HTTP request does not match the configured referer-host rule, the user can determine whether to match the referer field with all whitelist rules.
  • When the function of matching the referer field in a URL request with whitelist rules is enabled, the referer field will be matched with all whitelist rules. If a match is found, the URL request is allowed.
  • When the function of matching the referer field with whitelist rules is disabled, the referer field will not be matched with all whitelist rules.

By default, the function of matching the referer field in a URL request with whitelist rules is enabled. If the function is disabled, you can run the undo referer-filter whitelist-all enable command to disable it.

The referer field is a part of an HTTP header. A browser adds the referer field to an HTTP request before sending it to a web server, so that the web server can understand the link of the web.

Example

# Create URL filtering profile profile_development, and add www.example.com to the referer-host rule.

<sysname> system-view
[sysname] profile type url-filter name profile_development
[sysname-profile-url-filter-profile_development] add referer-host www.example.com
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >