cancel
Showing results for 
Search instead for 
Did you mean: 

Redirect https://<host>/ to https://<host>/irj by only using Java AS

Former Member
0 Kudos

Hi,

We are migrating away from IIS and IISProxy, and therefore need find a new way of redirecting from https://<host>/ to https://<host>/irj . We need to have a redirect (not an alias) since there are a lot of existing urls which are using irj as part of it. The redirect should be a server side HTTP 302 redirect, not a client side javascript redirect.

Our load balancer works at a lower level of the OSI stack, and it can therefore not perform this.

I've found that it is the application com.sap.engine.docs.examples which binds the / context root, and I can always (re)move this and create a new J2EE application which does the work. But this is uneccassary complex.

The HTTP alias, are as the name implies, and alias, and not a redirect.

How has other portals solved this problem?

Dagfinn

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Too little time to create the blog unfortunately and the need has evaporated.

HuseyinBilgen
Active Contributor
0 Kudos

Try using Apache ReverseProxy for Redirection...

As a guidance, follow the weblog;

regards

Former Member
0 Kudos

Hi,

That is of course a possible way to do it, though I need to do it by only using Java AS (as you can see in the subject ). I would prefer not to overcomplicate the landscape because of this.

(and reverse proxy doesn't do the redirect I would like, instead it functions as an alias. mod_rewrite is close to what I would like)

Dagfinn

HuseyinBilgen
Active Contributor
0 Kudos

Using only Java AS, hmmm

then you'd better use web dispatcher which is part of the Java AS.

Web Dispatcher does redirection as you required. Check the weblog for installation on Suse

and for windows with redirection info

Former Member
0 Kudos

Hehe ,

sorry we are not using web dispatcher for our portal system(not good enough performance), using an external loadbalancer which does NAT routing (therefore we cannot do the redirect there).

I'll give you some points though

Dagfinn

HuseyinBilgen
Active Contributor
0 Kudos

Hi,

point is not the point at the moment.

But, then modifying index.html file under irj/root folder on server for redirection / to /irj will not be accepted by you. Am I right?

Former Member
0 Kudos

Hi,

Modifying the index.html under the irj folder will not help, since it the irj application is bound to the /irj context root. However, the com.sap.engine.docs.examples binds to the / context root and in here I could change the index.html. But I'd rather stop/move the com.sap.engine.docs.examples application to another context root and deploy a new J2EE application which to the / context root and do a simple redirect from a servlet here (but then this application need to be maintained etc. Even though the actual implementation would take less than an hour, it is a custom developed solution which adds complexity) . Still, this is the solution I am leaning against now.

But I had hoped it wouldn't be this difficult. In the same way you have the HTTP alias in Java AS, you should have some simple rewrite rules.

Perhaps if I find some method of attaching a global servlet filter, I could build a mod_rewrite for Java AS.

Dagfinn

Former Member
0 Kudos

Actually managed to create a mod_rewrite web application based on the UrlRewriteFilter found here http://tuckey.org/urlrewrite/

Basically all you need is to:

1. Remove the com.sap.engine.docs.examples (or change context root on it)

2. Create a web module containing the jar file of UrlRewriteFilter in web-inf\lib and the config file in web-inf

3. Create an ear project and include the web moduel with context root \

4. Change the config file of UrlRewrite filter

and voila!

Of course, I am sceptic to use this, espeically since I believe all request now will be processed through the rewrite filter.

probably write a weblog about it when I have the time.

HuseyinBilgen
Active Contributor
0 Kudos

Yessss,

we will be waiting...