304
Configuring a match rule for URL redirection
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.
To configure a match rule for URL redirection:
Step Command
Remarks
1.
Enter system view.
system-view
N/A
2.
Create a portal Web server
and enter its view.
portal web-server
server-name
By default, no portal Web servers
exist.
3.
Configure a match rule for
URL redirection.
if-match
{
original-url
url-string
redirect-url
url-string
[
url-param-encryption
{
aes
|
des
}
key
{
cipher
|
simple
}
string
] |
user-agent
string
redirect-url
url-string
}
By default, no URL redirection
match rules exist.
Configuring a local portal Web service
Restrictions and guidelines for configuring a local portal Web
service
When you configure a local portal Web service, follow these restrictions and guidelines:
•
For an interface to use the local portal Web service, the URL of the portal Web server specified
for the interface must meet the following requirements:
{
The IP address in the URL must be the IP address of a Layer 3 interface (except 127.0.0.1)
on the device, and the IP address must be reachable to portal clients.
{
The URL must be ended with
/portal/
. For example:
http://1.1.1.1/portal/
.
•
You must customize the authentication pages and upload them to the device.
Customizing authentication pages
Authentication pages are HTML files. Local portal authentication requires the following
authentication pages:
•
Logon page
•
Logon success page
•
Logon failure page
•
Online page