For rewrite rules I use a more complicated rewrite so that I can write ERRest routes like
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" ;
}