skip to main content

SAP NetWeaver Newbie

URL Aliasing using SAP Web Dispatcher

The URLs that you have to send to your customers may be long and ugly. SAP Web Dispatcher provides a way to alias the URL to something simple by using action files.

Action files are declared in the web dispatcher using icm/HTTP/mod_0
icm/HTTP/mod_0 = PREFIX=/,FILE=/path-to/action_file.txt

Assuming the url is http://<host>:<wd-port>/the-big-ugly-url-that-I-dont-want-to-expose and the alias you wish to use is http://<host>:<wd-port>/customername-1-alias

Create action_file.txt with the following content
RegIRewriteUrl ^/customername-1-alias(.*) /the-big-ugly-url-that-I-dont-want-to-expose [qsreplace]

RegIRewriteUrl indicates rewrite method is called
^/customername-1-alias(.*) is a regular expression. ^ indicates beginning with and (.*) assigns the rest of the expression to a variable $1. You can use mutiple variables as input arguments
[qsreplace] option indicates that the original query string  will be replaced by the new query string

Therefore when http://<host>:<wd-port>/customername-1-alias is called, /customername-1-alias is replaced as /the-big-ugly-url-that-I-dont-want-to-expose

If you wish to replace http://<host>:<wd-port>/the-big-ugly-url-that-I-dont-want-to-expose/variable-followup-string-that-must-be-passed, add the following line:
RegIRewriteUrl ^/customername-2-alias/(.*) /the-big-ugly-url-that-I-dont-want-to-expose/$1 [qsreplace]

When http://<host>:<wd-port>/customername-2-alias/variable-followup-string-that-must-be-passed is called, it is replaced sent as http://<host>:<wd-port>/the-big-ugly-url-that-I-dont-want-to-expose/variable-followup-string-that-must-be-passed

No comments:

Post a Comment

Email Subscription

Get every new post into your inbox by subscribing us.

Want a reason to subscribe?
1. This sitemap might convince you to subscribe.
2. We do not misuse email IDs. We respect privacy.

© 2008 - 2017 sapnwnewbie. All rights reserved.