cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with RegEx and Web Dispatcher

0 Kudos

Hello Everyone,

We are using SAP's Web Dispatcher (latest version).  It works, but I'm trying to refine things and am having a heck of a time getting the syntax correct with the regex in our filter_rules.txt to replace the query string so things work properly.

Basically, I'm trying to get it so this:

http://abc.company.com/webdynpro/resources/vp/vpapp?sap-cssurl=http://xyz.company.com/webdynpro/sources/ur_ie6.css?7.3.1.10.13

shows up as:

http://abc.company.com/

to the end user.

Now, aside from the end-user currently being able to see the entire URL, the query string portion isn't working properly because it is showing (and therefore trying to access) the real, internal server, name, which obviously isn't going to work in the outside world.

So, the two objectives I'm trying to achieve are 1.  Only show the user the http://abc.company.com URL and 2.  Replace the http://xyz.company.com part of the query string with http://abc.company.com.

I've been playing around with the [qsreplace] action, but I'm obviously missing something since it's not working as intended.  Here is a chunk of our Filter_rules.txt:

if %{HTTP_HOST} RegIMatch abc.company.com*

SetHeader x-sap-webdisp-target-sid PDQ

if %{HTTP_HOST} RegIMatch abc.company.com*http://www.supplier.mccormick.com

RegIRewriteUrl ^/$ /webdynpro/resources/company.com/vp/VPApp [break]

Now, that alone at least allows the end user to get to the site, but as mentioned, it reveals the entire URL to them and the query string subsequently doesn't really work since it's looking for the internal server name.

So, I altered the filter rules to look like this:

if %{HTTP_HOST} RegIMatch abc.company.com*

SetHeader x-sap-webdisp-target-sid PDQ

if %{HTTP_HOST} RegIMatch abc.company.com*http://www.supplier.mccormick.com

RegIRewriteUrl ^/$ /webdynpro/resources/company.com/vp/VPApp

?sap-cssurl=http://abc.company.com/webdynpro/resources/sap.com/tc~wd~dispwda/global/SSR/themes/vendorportal/ur/u... [qsreplace]

When I did that, everything appeared to be working as I wanted.  But then upon trying to navigate around the site, everywhere I clicked I received a 403 Not Authorized return code.

So, I'm getting close, but I'm tired of beating my head against the wall (I hate regex). 

Any suggestions?  Was that enough info?  Oh, and we are running the latest 7.2 version of Web Dispatcher and it is reverse-proxying for a 7.3 portal.

Thanks,

Tom

Accepted Solutions (0)

Answers (1)

Answers (1)

hofmann
Active Contributor
0 Kudos

Well, before you post links to internal / external systems, make sure you really want them to be visible. While you tried to hide the company name with abc or xyz, http://www.supplier.mccormick.com is still visible.

Then, you should consider making ICM web administration visible to only internal systems. Right now, www.supplier.mccormick.com/sap/admin is accessible from outside. (see the host parameter)

About the sap-cssurl parameter: that parameter is usually used by the portal to communicate its CSS version to enforce the SAP Portal theme. You can configure WD themes in the web dynpro configuration to define a default theme. Then, the parameter is not needed. The file actually exists on your external URL: http://www.supplier.mccormick.com/webdynpro/resources/sap.com/tc~wd~dispwda/global/SSR/themes/vendor...

Shouldn't be a problem to make your WD app use that theme by default.

Do hide the technical information, you should use the SAP Portal. What has been done with the custom app can also be done easily with the SAP Portal. This will hide the URL params behind an iView and the portal URL.

0 Kudos

Thanks Tobias.  Not a problem with it being visible externally since its final purpose is to be a public website. 

Thank you for the info regarding sap-cssurl.  I'll pass this on to our developer and hopefully they can use the externally defined theme.

Thanks,

Tom

hofmann
Active Contributor
0 Kudos

You supplier site is intended to be public, but the admin site of ICM? Not sure how ICM is treating auto blocking users, but in case it doesn't: brute force or blocking the usual admin accounts: icmadmin, admin, ...

anja_engelhardt2
Active Contributor
0 Kudos

moved to SAP NetWeaver Application Server by moderator