If the storage path of resources on your origin server changes but you want users to use the original URL to access the resources, you can use the URL rewrite feature to rewrite the URL on Edge Security Acceleration (ESA) points of presence (POPs). ESA allows you to rewrite the URL path and query string in requests before they are redirected to origin servers.
The URL rewrite feature does not affect the internal links or cache keys of ESA. This feature allows only ESA POPs to access origin servers with rewritten URLs.
Examples
Example 1: Rewrite only the URL path
Example 2: Rewrite the URL path and query string
Create a URL rewrite rule
Log on to the ESA console.
In the left-side navigation pane, click Websites.
On the Websites page, find the website that you want to manage, and click the website name or View Details in the Actions column.
In the left-side navigation tree, choose
.Click the Rewrite URL tab.
Click Create Rule. On the page that appears, enter a rule name in the Rule Name field.
In the If requests match... section, specify the conditions for matching incoming requests. In the Rewrite URL section, configure the Path and Query String parameters.
Rewrite object
Operation
Description
Example
Path
Retain
Retains the path in the original request.
-
Rewrite to...
Replaces the path in the original request with the destination path.
NoteOnly the static rewrite method is supported. You can specify only a string for this parameter.
If the original URL is https://example.com/examplefile.png
and you specify /image/example.png for this parameter,
the rewritten origin URL is https://example.com/image/example.png.
Query String
Retain
Retains the query string in the original request.
-
Rewrite to...
Replaces the query string in the original request with the destination query string.
NoteOnly the static rewrite method is supported. You can specify only a string for this parameter.
If the original URL is https://example.com/examplefile.png?code=123
and you specify code=321 for this parameter,
the rewritten origin URL is https://example.com/examplefile.png?code=321.
Click OK.