• 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: Tim Worman <email@hidden>
  • Date: Tue, 11 Sep 2012 11:47:19 -0700

Raymond,

The port number in the URL you posted implies that your app is not running through apache.

Once that is solved, this is what I am doing through apache mod_rewrite.

Properties:
#rewrite the app urls
er.extensions.ERXApplication.replaceApplicationPath.pattern=/cgi-bin/WebObjects/appname.woa
er.extensions.ERXApplication.replaceApplicationPath.replace=/appname

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

The bottom line here is that is that your mod_rewrite rule has to produce a url that matches the Wonder pattern property. If it isn't working, you're gonna have to turn on your rewrite logging and check the logs to figure out why.

RewriteLog "/var/log/apache2/rewrite.log"
RewriteLogLevel 9

And here is a great cheat sheet for mod_rewrite.

http://www.addedbytes.com/cheat-sheets/mod_rewrite-cheat-sheet/

Tim
UCLA GSEIS

On Sep 11, 2012, at 7:56 AM, Raymond NANEON <email@hidden> wrote:

> Hi Pascal,
>
> I tried all possibilities but nothing work :(
>
> apache.conf
>
> LoadModule rewrite_module modules/mod_rewrite.so
> LoadModule WebObjects_module modules/mod_WebObjects.so
>
> ...
>
> RewriteEngine On
> RewriteRule ^/Students(.*)$ /cgi-bin/WebObjects/Dossier-Etudiants.woa/wa$1 [PT,L]
>
> httpd.conf
>
> ....
> LoadModule rewrite_module modules/mod_rewrite.so
> LoadModule WebObjects_module modules/mod_WebObjects.so
>
> webobjects.conf
>
> LoadModule rewrite_module modules/mod_rewrite.so
> LoadModule WebObjects_module modules/mod_WebObjects.so
>
> ...
>
> RewriteEngine On
> RewriteRule ^/Students(.*)$ /cgi-bin/WebObjects/Dossier-Etudiants.woa/wa$1 [PT,L]
>
>
> Result : http://agecanonix-form.utt.fr:43836/Students/myDefault/Dossier/Dossier/Dossier/Dossier/Dossier-Etudiants.woa/wa/myDefault
>
>
> And you are 100% sure that you are not using direct connect and that the app is running with Apache, wotaskd and the adaptor?
> ===> I don't know it the server is using direct connect. I know if we turn off wotaskd, all apps continue to work. How can I configue my app to run with apache?
>
>
> Thank
> Envoyé depuis iCloud
>
> Le 11 sep 2012 à 05:30, Pascal Robert <email@hidden> a écrit :
>
>>
>> Le 2012-09-11 à 08:27, Raymond NANEON <email@hidden> a écrit :
>>
>> > Hi Pascal,
>> >
>> > I do all changes but nothing works for me. Do you load mod_rewrite.so in your apache conf?
>>
>> Well, yes or it will not work… And it have to be loaded before the WebObjects module.
>>
>> > apache.conf :
>> >
>> > RewriteRule ^/Students(.*)$ /cgi-bin/WebObjects/Dossier-Etudiants.woa/wa$1 [PT,L]
>> >
>> > Properties :
>> >
>> > er.extensions.ERXApplication.replaceApplicationPath.pattern=/cgi-bin/WebObjects/Dossier-Etudiants.woa/wa
>> > er.extensions.ERXApplication.replaceApplicationPath.replace=/Students
>> >
>> > DirectAction.java :
>> >
>> > public WOActionResults myDefaultAction() {
>> > if (useCasService())
>> > return loginCASPage();
>> > else
>> > return loginNoCasPage(null);
>> > }
>> >
>> > Result : http://agecanonix-form.utt.fr:40840/Students/myDefault/Dossier/Dossier/Dossier/Dossier-Etudiants.woa/wa/myDefault
>>
>> And you are 100% sure that you are not using direct connect and that the app is running with Apache, wotaskd and the adaptor?
>>
>> > Envoyé depuis iCloud
>> >
>> > Le 11 sep 2012 à 05:04, Pascal Robert <email@hidden> a écrit :
>> >
>> >>
>> >> Le 2012-09-11 à 07:52, Raymond NANEON <email@hidden> a écrit :
>> >>
>> >> > Hi Pascal,
>> >> >
>> >> > I followed the wocommunity slide but It doesn't work :
>> >> >
>> >> > Application.java
>> >> >
>> >> > public String _rewriteURL(String url){
>> >> > String processedURL = url;
>> >> > if(url != null && _replaceApplicationPathPattern != null && _replaceApplicationPathReplace != null){
>> >> > processedURL = processedURL.replaceFirst(_replaceApplicationPathPattern, _replaceApplicationPathReplace);
>> >> > }
>> >> > return processedURL;
>> >> > }
>> >> >
>> >> > Apache.conf
>> >> >
>> >> > RewriteEngine On
>> >> > RewriteRule ^/Profil(.*)$ /cgi-bin/WebObjects/Dossier-Etudiants.woa/wa$1 [PT,L]
>> >> >
>> >> > Properties file
>> >> >
>> >> > er.extensions.ERXApplication.replaceApplicationPath.pattern=/cgi-bin/WebObjects/Dossier-Etudiants.woa
>> >> > er.extensions.ERXApplication.replaceApplicationPath.replace=/Profil
>> >> >
>> >> > In result I have this url : http://imac-cedre.utt.fr:1242/Profil/wa/myDefault/Dossier/Dossier/Dossier/Dossier/Dossier-Etudiants.woa/wa/myDefault instead of it : http://imac-cedre.utt.fr:1242/Profil
>> >>
>> >> Your rules doesn't match. In Apache you say Dossier-Etudiants.woa/wa but in the properties you didn't put the /wa …
>> >>
>> >> For WOCommunity.org, I use:
>> >>
>> >> RewriteRule ^/page(.*)$ /apps/WebObjects/WOCommunityPublic.woa/wa$1 [PT,L]
>> >>
>> >> Properties:
>> >>
>> >> er.extensions.ERXApplication.replaceApplicationPath.pattern=/apps/WebObjects/WOCommunityPublic.woa/wa
>> >> er.extensions.ERXApplication.replaceApplicationPath.replace=/page
>> >>
>> >> So everything matches. And the rewriting won't work with direct connect...
>> >>
>> >> > What am I doing wrong?
>> >> >
>> >> > thanks
>> >> > Envoyé depuis iCloud
>> >> >
>> >> > Le 11 sep 2012 à 02:33, Raymond NANEON <email@hidden> a écrit :
>> >> >
>> >> >> Thanks to Pascal and Adalbert for them reactivity. I go to see wocommunity slide to fix my problem.
>> >> >>
>> >> >> Ray
>> >> >> Envoyé depuis iCloud
>> >> >>
>> >> >> Le 11 sep 2012 à 02:20, Pascal Robert <email@hidden> a écrit :
>> >> >>
>> >> >>> http://fr.slideshare.net/wocommunity/errest (page 32)
>> >> >>>
>> >> >>> http://fr.slideshare.net/wocommunity/hidden-treasures-in-project-wonder (page 13)
>> >> >>>
>> >> >>> http://wiki.wocommunity.org/display/documentation/Configuring+Apache+for+WebObjects
>> >> >>>
>> >> >>> > Hi List,
>> >> >>> >
>> >> >>> > I want to rewrite my new app url http://myserver/cgi-bin/WebObjects/myapp to http::/myserver/myapp. Which parameter can I use in properties file to change it?
>> >> >>> >
>> >> >>> > Thanks for your help.
>> >> >>> > Envoyé depuis iCloud
>> >> >>> > _______________________________________________
>> >> >>> > 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
>> >> >>>
>> >> >> _______________________________________________
>> >> >> 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
>> >>
>>
> _______________________________________________
> 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


 _______________________________________________
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


  • Follow-Ups:
    • Re: Rewrite WO app URL
      • From: Raymond NANEON <email@hidden>
References: 
 >Rép : Re: Rewrite WO app URL (From: Raymond NANEON <email@hidden>)

  • Prev by Date: Re: Rép : Re: Rewrite WO app URL
  • Next by Date: Re: ERPDFGeneration with FOP and examples
  • Previous by thread: Re: Rép : Re: Rewrite WO app URL
  • Next by thread: Re: Rewrite WO app URL
  • Index(es):
    • Date
    • Thread