Is it possible to clean up the urls generated by WO in WO? I don't plan on using Apache, so that sorta eliminates mod_rewrite :-) Shorter URLs aren't a necessity, but it would be nice to have.
Your webserver will have to support some sort of rewriting.

If you use wonder, the app half is easy:

er.extensions.ERXApplication.replaceApplicationPath.pattern=/cgi-bin/ WebObjects/YourApp.woa
er.extensions.ERXApplication.replaceApplicationPath.replace=/YourApp

All URL generation in Wonder passes through this filter, so all your URLs will get chopped (if you look at the new AjaxExample I posted, it's using this).

I actually automatically do this in our application base class if direct connect is enabled:

if (replaceApplicationPathPattern == null && rewriteDirectConnectURL() && ERXProperties .booleanForKeyWithDefault("com.mdimension.rewriteDirectConnect", true)) { replaceApplicationPathPattern = "/cgi-bin/WebObjects/" + name() + ".woa";
      if (replaceApplicationPathReplace == null) {
        replaceApplicationPathReplace = "";
      }
    }

In Apache, you would setup the rewrite rule for this as:

RewriteRule ^/yourapp(.*)$ /cgi-bin/WebObjects/YourApp.woa$1 [PT,L]

But if you're not using Apache, you would need to figure out what the equivalent is.

If you need more complex rewriting in Wonder, you can override _rewriteUrl in ERXApplication and implement your own custom rewriting logic, but again, whatever the app produces will have to match what your app rewrites URLs to.

ms
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to