cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dispatcher: masking/hiding external URL

Former Member
0 Kudos

Hi,

I am configuring our Web Dispatcher to redirect to external URL with below scenario:

Web Dispatcher URL: http://wd.mycompany.com/EXT

External URL: http://www.external.com/

The URL redirection is working fine -  accessing http://wd.mycompany.com/EXT will be redirected to http://www.external.com, but browser is now showing http://www.external.com instead of http://wd.mycompany.com/EXT.

I understand we can do masking/hiding SAP back-end URL.

My question: is it possible to mask/hide external URL using Web Dispatcher? How to do that?

Regards,

Hari

Accepted Solutions (1)

Accepted Solutions (1)

isaias_freitas
Advisor
Advisor
0 Kudos

Hello,

As Shi Feng said, any URL redirect will not help you achieve what you want.

If the Web Dispatcher in use is from a recent release (I recommend using the Web Dispatcher 742), you can configure it for multiple systems, using the parameter "wdisp/system_X".

wdisp/system_<xx> - SAP Web Dispatcher - SAP Library

Then, you can create one external system, like "SID=EXT, EXTSRV=...".

The requests would still go through the Web Dispatcher. Thus, the URL will me masked as you want.

Cheers,

Isaías

SUMANTH2
Participant
0 Kudos

Hi Isaias,

I have similar requirement but with slight difference.

Our Scenario is, When user types https://gateway.mycompany.com/timeclock

This request should be redirected or rewritten to https://gateway.mycompany.com//sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?sap-ushell-...

After successful authentication and during response, we should replace the URI back with timeclock.

In the End URL should remain in browser as https://gateway.mycompany.com/timeclock

Tried with below modification rules but did not get the intended result.

SetHeader clientProtocol HTTPS

RegIRedirectUrl ^/timeclock(.*) /sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?sap-ushell-config=standalone#TimeEventExt-manageCorrections [noescape]

RegIRewriteUrl ^/sap/bc/ui5_ui5/ui2/ushell/shells/abap/FioriLaunchpad.html?sap-ushell-config=standalone#TimeEventExt-manageCorrections /timeclock [qsreplace]

Appreciate any suggestions..

Thanks

Sumanth

isaias_freitas
Advisor
Advisor
0 Kudos

Hello Simanth,


After successful authentication and during response, we should replace the URI back with timeclock.

The Web Dispatcher can modify the request before forwarding it to the backend.

What you need is to modify the response sent by the backend, before the Web Dispatcher forwards the response back to the client (internet browser). As far as I know, it is not possible to do this with the Web Dispatcher.

In fact, the Web Dispatcher can modify the responses, but not the URI from the response.

Regards,

Isaías

Answers (1)

Answers (1)

feng_shi
Active Participant
0 Kudos

Hi,

I would say that it is how URL redirect works(your client browser will be asked to go to the new URL) .

If you want your client to see http://AAAA:port/A/A URL in the browser, but actual content of http://BBBB:port/B/B URL, you should define Modification Actions to use URL Rewrite.

please see following document:

https://help.sap.com/saphelp_nw70ehp2/helpdata/en/48/9266acaa6b17cee10000000a421937/frameset.htm

Thanks and best regards,

Shi Feng

Former Member
0 Kudos

Thanks for your reply.

I did use Modification Actions:

#-----------------------------------------------------------------------

# Redirect to C4C

#-----------------------------------------------------------------------

if %{SERVER_PORT} = 9443 [and] if %{PATH} regimatch "/EXT"

begin

RegIRewriteUrl ^EXT(.*) /sap/c4c/odata/cust/v1/servicerequests$1

RegIRedirectUrl ^/sap/c4c/odata/cust/v1/servicerequests(.*) https://my123456.crm.ondemand.com/sap/c4c/odata/cust/v1/servicerequests$1

end

#-----------------------------------------------------------------------

# Redirect to local Gateway servers by port

#-----------------------------------------------------------------------

if %{SERVER_PORT} = 6443

SetHeader x-sap-webdisp-target-sid GWD [break]

if %{SERVER_PORT} = 7443

SetHeader x-sap-webdisp-target-sid GWQ [break]

if %{SERVER_PORT} = 8443

SetHeader x-sap-webdisp-target-sid GWP [break]

Test redirection to local SAP Gateway:

https://wd.mycompany.com:6443/<anypath> is redirected to GWD

In browser, URL remains as https://wd.mycompany.com:6443/<anypath>

Test redirection to C4C:

https://wd.mycompany.com:9443/EXT is redirected to https://my123456.crm.ondemand.com/sap/c4c/odata/cust/v1/servicerequests

In browser, URL shows https://my123456.crm.ondemand.com/sap/c4c/odata/cust/v1/servicerequests

I am expecting the URL remains using https://wd.mycompany.com:9443/

In Apache, proxyPassReverse can handle this but not exist in Web Dispatcher.

Therefore, I'm looking for any advice whether we can do this external URL masking/hiding with Web Dispatcher.

feng_shi
Active Participant
0 Kudos

Hi,

if you want to keep the URL in client browser, you should NOT use URL redirect (RegIRedirectUrl).

in this case, why are you using RegIRedirectUrl ? just using RegIRewriteUrl is not OK ?

For example, like below:

#-----------------------------------------------------------------------

# Redirect to C4C

#-----------------------------------------------------------------------

if %{SERVER_PORT} = 9443 [and] if %{PATH} regimatch "/EXT"

begin

RegIRewriteUrl ^EXT(.*) https://my123456.crm.ondemand.com/sap/c4c/odata/cust/v1/servicerequests$1

end

Thanks and best regards,

Shi Feng