< Home

match-rule user-agent client-type

Function

The match-rule user-agent client-type command adds a user-defined terminal type matching rule. After the rule is configured, the virtual gateway identifies whether the browser is on a PC or a mobile smart terminal by checking the User-Agent string, and then sends the web pages optimized for the browser.

The match-rule user-agent client-type command adds a user-defined terminal type matching rule.

Format

match-rule user-agent user-agent client-type { pc | mobile }

undo match-rule user-agent user-agent client-type { pc | mobile }

Parameters

Parameter Description Value
user-agent

Specifies the User-Agent string that is obtained from the client. This string contains the basic information about the browser.

The value is a string of 1 to 127 case-sensitive characters. The wildcard asterisk (*) is supported.
client-type

Specifies the terminal type of User-Agent.

-
pc

Indicates that the terminal is a PC.

-
mobile

Indicates that the terminal is a smart mobile terminal.

-

Views

Basic view

Default Level

2: Configuration level

Usage Guidelines

Only the USG6510E/6510E-POE/6530E does not support this command.

Example

# Define a rule that identifies the browser whose User-Agent field contains string *firefox* as a PC browser.

<sysname> system-view
[sysname] v-gateway VgName001
[sysname-VgName001] basic
[sysname-VgName001-basic] match-rule user-agent *firefox* client-type pc
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >