Re: Having WO respond to direct URLs
Re: Having WO respond to direct URLs
- Subject: Re: Having WO respond to direct URLs
- From: Sacha Mallais <email@hidden>
- Date: Mon, 19 Sep 2005 10:11:27 -0700
On Sep 19, 2005, at 9:55 AM, Danny Wang wrote:
I'm trying to get an app running where I can have users of the site
hit their home page/portal when they type http://mywebsite/
username. The users will get created automatically and user names
will be unique. The questions is how do I get WO to respond to URLs
like that? It'll be ok to have a redirection (to the WO app URL),
but I can't think of a way to automatically generate that URL and
have my WO app respond to it.
Or, even if there's no good way to have it get automatically
created, it would be nice to have that kind of a link somehow. The
only thing I can think of is to create the directory in the
WebServer directoy and put a html page that redirects to the WO app
using Direct Actions.
You need two things to make this happen:
- Apache rewrite rules similar to this:
RewriteRule ^/cgi-bin
- [last]
RewriteRule ^/(.+) /cgi-bin/WebObjects/MyApp.woa/wa/displayUser?
username=$1 [last,passthrough]
The first tells Apache not to rewrite URLs that begin with cgi-bin,
the second rewrites everything else to go to the direct action
displayUserAction.
- a direct action called displayUserAction, in which you will need to
manually get the passed in user name from the WORequest.
sacha
--
Sacha Michel Mallais Senior Developer / President
Global Village Consulting Inc. http://www.global-village.net/
PGP Key ID: 7D757B65 AIM: smallais
Bottom posting is your friend:
http://www.river.com/users/share/etiquette/
Attachment:
PGP.sig
Description: This is a digitally signed message part
_______________________________________________
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