Thanks Chuck you saved the day yet again.
However it doesn't seem to return the correct response.content() the second System.out.println I do shows that it has been replace but the generated page still contains the cgi-bin references?
public WOResponse dispatchRequest(WORequest request) { if ("/favicon.ico".equals(request.uri())) { return new WOResponse(); } WOResponse response = super.dispatchRequest(request); String contentType = response.headerForKey("content-type"); if ((contentType == null) || (contentType.toLowerCase().indexOf("text/html") > - 1)) { response.setContent( response.contentString().replaceAll( "/cgi-bin/WebObjects/", "" ) ); System.out.println("WOResponse = " + response.contentString() );
return response; } return super.dispatchRequest(request);
}
Regards David Elsner Ph 61+02 42214251
On 09/03/2006, at 3:01 PM, Chuck Hill wrote: Hi Dave,
On Mar 8, 2006, at 7:56 PM, Dave Elsner wrote:
I know this issue has been covered many times before but I still can't seem to find a solution to:
How to remove the "cgi-bin/WebObjects/appName.woa" from the URL permanently ?
I have set up Apaches modRewrite so I can navigate to the Domain name, but as soon as I navigate from the front page the site the URL goes back to using " cgi-bin/WebObjects/appName.woa" How came I change the application so that all hyperlinks and form submit return a URL like:
My rewrite rule would look some thing like: RewriteRule ^/appname.woa.* /cgi-bin/WebObjects/appname.woa$1 [L,PT]
Can I do this in appendToResponce ? pageWithName? or changing the Monitors path to the WO Adaptor?
In a nutshell, you have to generate the URLs yourself. There are many ways of doing this:
1. Create a class that generates the URL and use this with the href bindings on the components 2. Create a custom WOContext subclass to generate the URLS you need 3. Use regex to find and change the URLs in dispatchRequest in Application (probably the best place)
Chuck
--
|