256
string
: Specifies the case-sensitive key string. The string length varies by the selected encryption
method:
•
If
des
cipher
is specified, the string length is 41 characters.
•
If
des
simple
is specified, the string length is 8 characters.
•
If
aes
cipher
is specified, the string length is 1 to 73 characters.
•
If
aes
simple
is specified, the string length is 1 to 31 characters.
user-agent
user-agent
: Specifies a user agent string to match the User-Agent string in
HTTP/HTTPS requests. The user agent string is a case-sensitive string of 1 to 255 characters. The
User-Agent string in HTTP or HTTPS requests includes information about hardware manufacturer,
operating system, browser, and search engine.
Usage guidelines
A URL redirection match rule matches HTTP or HTTPS requests by user-requested URL or
User-Agent information, and redirects the matching HTTP or HTTPS requests to the specified
redirection URL.
For a user to successfully access a redirection URL, configure a portal-free rule to allow HTTP or
HTTPS requests destined for the redirection URL to pass. For information about configuring
portal-free rules, see the
portal free-rule
command.
For a portal Web server, you can configure the
url
command and the
if-match
command for URL
redirection. The
url
command redirects all HTTP or HTTPS requests from unauthenticated users to
the portal Web server for authentication. The
if-match
command allows for flexible URL redirection
by redirecting specific HTTP or HTTPS requests to specific redirection URLs. If both commands are
executed, the
if-match
command takes priority to perform URL redirection.
If you configure encryption for parameters in the redirection URL, you must add an encryption
prompt field after the redirection URL address. For example, to redirect HTTP requests to URL
10.1.1.1 with encrypted URL parameters, specify the redirection URL as http://10.1.1.1?yyyy=. The
value of yyyy depends on the portal Web server configuration. For more information, see the portal
Web server configuration guide.
Examples
# Configure a match rule to redirect HTTP requests destined for the URL http://www.abc.com.cn to
the URL http://192.168.0.1.
<Sysname> system-view
[Sysname] portal web-server wbs
[Sysname-portal-websvr-wbs] if-match original-url http://www.abc.com.cn redirect-url
http://192.168.0.1
# Configure a match rule to redirect HTTP requests that carry the user agent string
5.0(WindowsNT6.1)AppleWebKit/537.36(KHTML,likeGecko)Chrome/36.0.1985.125Safari/537.36
to the URL http://192.168.0.1.
<Sysname> system-view
[Sysname] portal web-server wbs
[Sysname-portal-websvr-wbs] if-match user-agent
5.0(WindowsNT6.1)AppleWebKit/537.36(KHTML,likeGecko)Chrome/36.0.1985.125Safari/537.36
redirect-url http://192.168.0.1
Related commands
display portal web-server
portal free-rule
url
url-parameter