• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Shorter URLs without mod_rewrite?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shorter URLs without mod_rewrite?


  • Subject: Re: Shorter URLs without mod_rewrite?
  • From: Mike Schrag <email@hidden>
  • Date: Thu, 15 May 2008 22:29:04 -0400

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@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Shorter URLs without mod_rewrite? (From: Rams <email@hidden>)

  • Prev by Date: Shorter URLs without mod_rewrite?
  • Next by Date: Re: Localize WOLips project
  • Previous by thread: Shorter URLs without mod_rewrite?
  • Next by thread: WO problem on Windows Server 2003
  • Index(es):
    • Date
    • Thread