WebSphere HTTP Server - rewrites to redirect html and jsps

This is Interesting: Free IT Magazines  
Home > Archive > WebSphere HTTP Server > April 2004 > rewrites to redirect html and jsps





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author rewrites to redirect html and jsps
Mark Salem

2004-04-13, 7:33 am

hi guys,
Just wondering if you guys can help or have implemented a similar
solution.

Right this is the Scenario, I have IBM IHS server and IBM Websphere V4
running on the same box. An application running say Trade, now I want
to put an outage page up whilst the app is still running in websphere,
so if anyone tries to hit Trade they will be presented with an
outagepage.html for example. I realise you can do this by using these
commands in the httpd.conf file

RewriteEngine on


RewriteCond d:/temp/outagepage.on -f
RewriteRule ^.*/WebSphereSamples/.*$ http://server/outage.html

And this works if some one tries to hit the url


http://server/WebSphereSamples/TradeSample/TradeDocs

But this what DOES NOT work and I have been banging my head against a
wall as to why it doesnt

JSP Request does work when it shouldnt, outage page not shown, jsp is
still delivered!!!

http://server/WebSphereSamples/TradeSample/welcome.jsp

So why is the rewrite rule working for html requests and not JSPs?

cheers in advance

Mark
Todd Kaplinger

2004-04-13, 10:33 am

Is the static html being served via the webserver and the dynamic
content being served via websphere? It appears that the loadModule for
websphere is handling the request prior to this rewrite condition for
the dynamic content.

Mark Salem wrote:
> hi guys,
> Just wondering if you guys can help or have implemented a similar
> solution.
>
> Right this is the Scenario, I have IBM IHS server and IBM Websphere V4
> running on the same box. An application running say Trade, now I want
> to put an outage page up whilst the app is still running in websphere,
> so if anyone tries to hit Trade they will be presented with an
> outagepage.html for example. I realise you can do this by using these
> commands in the httpd.conf file
>
> RewriteEngine on
>
>
> RewriteCond d:/temp/outagepage.on -f
> RewriteRule ^.*/WebSphereSamples/.*$ http://server/outage.html
>
> And this works if some one tries to hit the url
>
>
> http://server/WebSphereSamples/TradeSample/TradeDocs
>
> But this what DOES NOT work and I have been banging my head against a
> wall as to why it doesnt
>
> JSP Request does work when it shouldnt, outage page not shown, jsp is
> still delivered!!!
>
> http://server/WebSphereSamples/TradeSample/welcome.jsp
>
> So why is the rewrite rule working for html requests and not JSPs?
>
> cheers in advance
>
> Mark


Mark Salem

2004-04-14, 1:33 pm

Hiya Todd

yes you are right static html served by the webserver and the dynamic
content by websphere.

Yes it seems the loadmodule is handling the request first, I thought
to get over this particular problem the 'rewrite' has to appear after
the loadModule in the HTTPD.conf file, excerpt below, but this still
doesnt work , any ideas
how to get around this



</files>
LoadModule ibm_app_server_http_module
d:/WebSphere/AppServer/bin/mod_ibm_app_server_http.dll

WebSpherePluginConfig d:\WebSphere\AppServer\config\plugin-cfg.xml

Alias /WebSphereSamples/TradeSample/
"d:/http_docs/TradeApp/WebsphereSamples/TradeSample/"

<Directory />
Options -Indexes
</Directory>

AddModule mod_rewrite.c
AddModule mod_alias.c
Alias /icons/ "d:/IBM HTTP Server/icons/"
Alias /IBMWebAS/ "d:/WebSphere/AppServer/web/"
Alias /WSsamples "d:/WebSphere/AppServer/WSsamples/"
ScriptAlias /cgi-bin/ "d:/IBM HTTP Server/cgi-bin/"

RewriteEngine on

#RewriteCond d:/temp/outagepage.on -f - needs to be paired with a
RewriteRule


RewriteCond d:/temp/outagepage.on -f
RewriteRule ^.*/WebSphereSamples/.*$ http://server/outage.html


Todd Kaplinger <kaplinger@alum.bentley.edu> wrote in message news:<407BEDE9.30002@alum.bentley.edu>...[color=darkred]
> Is the static html being served via the webserver and the dynamic
> content being served via websphere? It appears that the loadModule for
> websphere is handling the request prior to this rewrite condition for
> the dynamic content.
>
> Mark Salem wrote:
Aaron W Morris

2004-04-14, 1:33 pm



Mark Salem wrote:

> Hiya Todd
>
> yes you are right static html served by the webserver and the dynamic
> content by websphere.
>
> Yes it seems the loadmodule is handling the request first, I thought
> to get over this particular problem the 'rewrite' has to appear after
> the loadModule in the HTTPD.conf file, excerpt below, but this still
> doesnt work , any ideas
> how to get around this
>



You could use mod_proxy instead of the WAS plugin. All content would be
served by WebSphere, but you wouldn't have the plugin interferring.

--
Aaron W Morris <aaronmorris@mindspring.com> (decep)

Mark Salem

2004-04-16, 10:33 am

This would have been an option Aaron , but this is a test box, we are
hoping to progress this outage page mechanism to a production strength
environment where we have a seperate webserver in a DMZ and the
Websphere box on an internal box,
do you think there is a problem with the Rewrite module itself?

cheers

Mark

Aaron W Morris <aaronmorris@mindspring.com> wrote in message news:<c5js2t$4h52$2@news.boulder.ibm.com>...
>
> You could use mod_proxy instead of the WAS plugin. All content would be
> served by WebSphere, but you wouldn't have the plugin interferring.

Aaron W Morris

2004-04-18, 10:33 am



Mark Salem wrote:

> This would have been an option Aaron , but this is a test box, we are
> hoping to progress this outage page mechanism to a production strength
> environment where we have a seperate webserver in a DMZ and the
> Websphere box on an internal box,
> do you think there is a problem with the Rewrite module itself?
>
> cheers
>
> Mark


No. I've had the same problem in the past. The WAS plugin just
intercepts the message before most other modules can get to it.

My experience has been with IHS, IHS 2 may have a different behavior.



--
Aaron W Morris <aaronmorris@mindspring.com> (decep)

Jerrel Adcock

2004-04-18, 10:33 am

May not be the case here, but I'll mention that mod_rewrite only appears
to work for/on/with static resources.

Fought with something similar to your problem on the 400.


Mark Salem wrote:
> hi guys,
> Just wondering if you guys can help or have implemented a similar
> solution.
>
> Right this is the Scenario, I have IBM IHS server and IBM Websphere V4
> running on the same box. An application running say Trade, now I want
> to put an outage page up whilst the app is still running in websphere,
> so if anyone tries to hit Trade they will be presented with an
> outagepage.html for example. I realise you can do this by using these
> commands in the httpd.conf file
>
> RewriteEngine on
>
>
> RewriteCond d:/temp/outagepage.on -f
> RewriteRule ^.*/WebSphereSamples/.*$ http://server/outage.html
>
> And this works if some one tries to hit the url
>
>
> http://server/WebSphereSamples/TradeSample/TradeDocs
>
> But this what DOES NOT work and I have been banging my head against a
> wall as to why it doesnt
>
> JSP Request does work when it shouldnt, outage page not shown, jsp is
> still delivered!!!
>
> http://server/WebSphereSamples/TradeSample/welcome.jsp
>
> So why is the rewrite rule working for html requests and not JSPs?
>
> cheers in advance
>
> Mark

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com