• 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: Rewrite WO app URL
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rewrite WO app URL


  • Subject: Re: Rewrite WO app URL
  • From: Ted Archibald <email@hidden>
  • Date: Tue, 11 Sep 2012 10:02:42 -0600

On the apps I use I like clean URLs, I've been using alot of ERRest to help as well.

For rewrite rules I use a more complicated rewrite so that I can write ERRest routes like server.com/AppName/Route/Whatever instead of server.com/AppName/ra/Route/Whatever:

RewriteRule ^AppName/([0-9]*/)?(?!(?:[0-9]*/)?ajax/|(?:[0-9]*/)?wis/|(?:[0-9]*/)?_wr_/|(?:[0-9]*/)?_sl_/|(?:[0-9]*/)?wa/|(?:[0-9]*/)?ra/|(?:[0-9]*/)?womp/|(?:[0-9]*/)?ja/|(?:[0-9]*/)?wo/|(?:[0-9]*/)?push/|(?:[0-9]*/)?wr/|(?:[0-9]*/)?ws/|(?:[0-9]*/)?erxadm/|(?:[0-9]*/?)?$)(.*)$ /cgi-bin/WebObjects/AppName.woa/$1ra/$2 [NC,PT,L]

RewriteRule ^AppName/([0-9]*/)?(ajax/|wis/|_wr_/|_sl_/|wa/|ra/|womp/|ja/|wo/|push/|wr/|ws/|erxadm/|(?:[0-9]*/))(.*)$ /cgi-bin/WebObjects/AppName.woa/$1$2$3 [NC,PT,L]

RewriteRule ^AppName(/[0-9]*)?$ /cgi-bin/WebObjects/AppName.woa [NC,PT,L]



The rewrite properties are simple though:

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



Then to get rid of the session ID in the url in my session class I have:

  @Override
  public void awake() {
    super.awake();   
      setStoresIDsInCookies(true);
      setStoresIDsInURLs(false);
  }
  
  @Override
  public String domainForIDCookies() {
    return ERXApplication.isDevelopmentModeSafe() ? super.domainForIDCookies() : "/" + "AppName" ;
  }

 _______________________________________________
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: 
 >Rép : Re: Rewrite WO app URL (From: Raymond NANEON <email@hidden>)
 >Re: Rewrite WO app URL (From: Pascal Robert <email@hidden>)
 >Re: Rewrite WO app URL (From: Adalbert Winkler <email@hidden>)

  • Prev by Date: Re: Rewrite WO app URL
  • Next by Date: Re: adding a component to a D2W page
  • Previous by thread: Re: Rewrite WO app URL
  • Next by thread: Re: Rép : Re: Rewrite WO app URL
  • Index(es):
    • Date
    • Thread