< Home

add { url | host } (user-defined URL category view)

Function

The add { url | host } command adds a URL or domain name rule to a user-defined category.

The undo add { url | host } command removes a URL or domain name rule from a user-defined category.

Format

add { url url-text &<1-2> | host host-text &<1-2> }

undo add { url { url-text &<1-2> | all } | host { host-text &<1-2> | all } }

Parameters

Parameter Description Value

url-text &<1-2>

Specifies a URL rule.

&<1-2> indicates that each command can configure a maximum of two strings at a time. When the URL contains over 255 characters, you need to enter two strings. The system automatically places the second string behind the first one to form a complete URL for matching. For example, if you configure add url www.example.com 123, the system stores it as www.example.com123 after processing.

  • The value is a character string. If the URL does not contain any space or question mark (?), the length is 4 to 255 characters. If the URL contains spaces or question marks (?) (not at the end), the URL must be enclosed by double quotation marks ("") and the length is 6 to 255 characters. Pre-processing removes http:// from the entered character string.

  • When you enter two strings, the URL obtained by combining the two strings contains a maximum of 480 characters.

  • If the URL contains double quotation marks (""), you need to replace them with escape characters "%22". For example, if the URL is www.example.com/abc/def?"gh, you need to enter www.example.com/abc/def?%22gh.

  • * indicates wildcard, which appears at the beginning, middle, or end of a URL and indicates suffix matching, keyword matching, and prefix matching, respectively. For example:
    • When the URL is configured as *abc, all URLs ending with abc are matched.
    • When the URL is configured as *a*bcd*, all URLs containing a and bcd in sequence are matched.
    • When the URL is configured as bcd*, all URLs starting with bcd are matched.
  • If a URL does not contain any wildcard, the URL must contain at least four consecutive characters, such as abcd. If the URL contains wildcard, it must contain at least three consecutive characters except the wildcard, such as *abc, *abc*, abc**, and *a*bcd.
  • If the entered URL ends with .*, there must be at least three common characters before .*. Take *.*.* as an example. It ends with .*. However, it does not contain three common characters before .*.

  • If the total length of the entered URL is 4, only one * exists at the beginning, and the length of the remaining common characters is 3, the last character cannot be .. Take *ab. as an example. Its total length is 4 and begins with *, and the length of the remaining common characters is 3. However, its last character is ..

url all

Indicates all URL rules.

-

host-text &<1-2>

Specifies a domain name rule.

&<1-2> indicates that each command can configure a maximum of two strings at a time. When the domain name contains over 255 characters, you need to enter two strings. The system automatically places the second string behind the first one to form a complete domain name for matching. For example, if you configure add host www.example.com 123, the system stores it as www.example.com123 after processing.

  • The value is a character string and the length is 4 to 255 characters, without special character slash (/), back slash (\), number sign (#), double quotation mark ("), question mark (?), or space.

  • When you enter two strings, the domain name obtained by combining the two strings contains a maximum of 480 characters.

  • * indicates wildcard, which appears at the beginning, middle, or end of a domain name and indicates suffix matching, keyword matching, and prefix matching, respectively. For example:
    • When a domain name is configured as *abc, all domain names ending with abc are matched.
    • When a domain name is configured as *a*bcd*, all domain names containing a and bcd in sequence are matched.
    • When a domain name is configured as bcd*, all domain names starting with bcd are matched.
  • If a domain name does not contain any wildcard, the domain name must contain at least four consecutive characters, such as abcd. If the domain name contains wildcard, it must contain at least three consecutive characters except the wildcard, such as *abc, *abc*, abc**, and *a*bcd.
  • If the entered domain name ends with .*, there must be at least three common characters before .*. Take *.*.* as an example. It ends with .*. However, it does not contain three common characters before .*.

  • If the total length of the entered domain name is 4, only one * exists at the beginning, and the length of the remaining common characters is 3, the last character cannot be .. Take *ab. as an example. Its total length is 4 and begins with *, and the length of the remaining common characters is 3. However, its last character is ..

host all

Indicates all domain name rules.

-

Views

User-defined URL category view

Default Level

2: Configuration level

Usage Guidelines

None

Example

# Add a URL rule www.example.com in the view of user-defined URL category abc and set the matching mode to Exact.

<sysname> system-view
[sysname] url-filter category user-defined name abc
[sysname-cate-user-defined-abc] add url www.example.com

# Add a URL rule bbs in the view of user-defined abc and set the matching mode to Keyword.

<sysname> system-view
[sysname] url-filter category user-defined name abc
[sysname-cate-user-defined-abc] add url *bbs*

# Add domain name rule www.example.com in the view of user-defined category abc and set the matching mode to Exact.

<sysname> system-view
[sysname] url-filter category user-defined name abc
[sysname-cate-user-defined-abc] add host www.example.com
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >