Home weblogic & OHS: How forward one url to a different server
Reply: 0

weblogic & OHS: How forward one url to a different server

user1847
1#
user1847 Published in May 27, 2018, 3:38 am

I have an environment with Oracle WebLogic and OHS running.

In the mod_wl_ohs.conf I have following (beside config for other applications)

  <Location /application1>
    SetHandler weblogic-handler
    WLLogFile /opt/logs/ application1.log
    Debug OFF
    WebLogicHost 127.0.0.1
    WebLogicPort 23666
  </Location>

This works fine the and the server listening to 23666 with the actual application1 application is handling the requests like “http://example.com/application1/*” .

Now I would like to redirect all requests for specific URL pattern to a different domain (not necessary on the same server), but continuing handling all requests others.
Redirect: http://example.com/application1/MagicKeyword/*
continue on: http://example.com/application1/NotTheKeyword* or http://example.com/application1/AlsoNotKeyword/*

What is the right approach for that?
I played around with some mod_rewrite rules, it seems they don’t take affect or break everything (in httpd.conf). I was also reading that we should not use mod_rewrite rules inside of location tag (can't find the reference now).
What else can I do?

Edit: So finally I found my error (somehow wrong syntax which not prevented the server from starting (like usual).

So I could: in httpd.conf

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule "(.*)/application1/MagicKeyword/(.*)$" "https://www.example.org" [NC,L,R=301]
</IfModule>

or in the Location tag add:

RewriteEngine On
RewriteRule "(.*)/MagicKeyword/(.*)$" "https://www.example.org" [NC,L,R=301]

Why should I prefer one over the other? Is there anything to concern about?

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.310251 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO