on 11-26-2012 9:10 AM
Hi together,
we're searching for a solution to mapp an requested URL (portalhost.olddomain.de) to an new URL (portalhost.newdomain.de).
If the requestet URL has an prefix like /irj/portal it should not be changed.
Is such a scenario possible with the sapwebdispatcher or do anybody now how I can solve this situation?
Thanks,
Heiko
Hello Heiko,
At what point in time do you want to apply the mapping? When the request is incoming from the client, or when a response is created from the back-end and the response contains old URLs?
The first option is possible with Web Dispatcher using the modification handler icm/HTTP/mod_0.
The latter is not possible with Web Dispatcher because it is not able to modify responses. In that case, you could use Apache Http Server as reverse proxy and make use of module mod_substitute.
Best,
Tobias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Heiko,
The SAP Web Dispatcher documentation has the chapter "Modifications of HTTP Requests":
http://help.sap.com/saphelp_nw73/helpdata/en/48/9266acaa6b17cee10000000a421937/frameset.htm
Your rule would probably look similar to this:
if %{HTTP_HOST} regimatch portalhost.olddomain.de [and]
if %{PATH_TRANSLATED} !regimatch ^/irj/portal
RegIRedirectUrl ^/(.*) http://portalhost.newdomain.de/$1 [CODE=permanent]
Good luck!
Tobias
Hell Tobias,
thanks for the syntax but it don't work.
In the profile of the sapwebdispatcher I set:
icm/HTTP/mod_0 = PREFIX=/, FILE=/sapmnt/><SID>/profile/icm_rules.txt
I can't find the parameter in the Webdispatcher-Administration.
I expect that the URL which is shown in the broswer wil switch to the new domain URL.
Am I right in this guess?
Heiko
Hello Heiko,
Did you restart Web Dispatcher after adding the line to its profile? You should see the rules in the Web Admin, otherwise they are not active. You also have to restart Web Dispatcher each time you make a change to the rule file.
You can check the trace dev_webdisp for errors during startup. Maybe it helps to add
rdisp/TRACE=3
to the profile before starting Web Dispatcher. This will set the trace to level 3, even at startup. The modification handler is initialized only at startup.
If the redirect works, the browser will show the new domain URL.
Tobias
OK,
I don't know why, but now it works nearly.
I can see the rule in the Web Admin now.
Now if I send a request on http://host.olddomain.de:54400/ it will redirect to http://host.newdomain.de:54400/ but it dosn't work with /irj/portal!
Do I have to change the PREFIX - parameter in the profile?
Or is there a mistake in the rule?
I feel, the solution is near!
Heiko
The redirect from http://host.olddomain.de:54400/irj/portal to http://host.newdomain.de:54400/irj/portal has not worked. All other links like ../irj worked.
So I add a slash to the following line in the rule file:
if %{PATH_TRANSLATED} !regimatch ^/irj/portal/
An now, it works fine!
Thanks a lot!
Bye,
Heiko
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.