Kom redirect

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Kom redirect

Nevin Pratt
Using Comanche with Seaside, how would one redirect

   http://www.mylocalhost.com

to

   http://www.mylocalhost.com/seaside/home

I know this isn't hard to do if I wish to change, say, WAKom (that's
exactly what I did with an earlier version of Comanche).  But I'd rather
not touch somebody else's code.

If Seaside was being fronted by Apache, the rewrite rule could be put
into the Apache config, so it isn't a problem there either.

But if I am using the latest version of Comanche?

Is there a standard way to do this using Comanche/Seaside?

Nevin
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Kom redirect

Philippe Marschall
2006/10/31, Nevin Pratt <[hidden email]>:

> Using Comanche with Seaside, how would one redirect
>
>    http://www.mylocalhost.com
>
> to
>
>    http://www.mylocalhost.com/seaside/home
>
> I know this isn't hard to do if I wish to change, say, WAKom (that's
> exactly what I did with an earlier version of Comanche).  But I'd rather
> not touch somebody else's code.
>
> If Seaside was being fronted by Apache, the rewrite rule could be put
> into the Apache config, so it isn't a problem there either.
>
> But if I am using the latest version of Comanche?
>
> Is there a standard way to do this using Comanche/Seaside?

Can't you just select home as default entry point?

Philippe
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Kom redirect

Nevin Pratt
Philippe Marschall wrote:

> 2006/10/31, Nevin Pratt <[hidden email]>:
>> Using Comanche with Seaside, how would one redirect
>>
>>    http://www.mylocalhost.com
>>
>> to
>>
>>    http://www.mylocalhost.com/seaside/home
>>
>> I know this isn't hard to do if I wish to change, say, WAKom (that's
>> exactly what I did with an earlier version of Comanche).  But I'd rather
>> not touch somebody else's code.
>>
>> If Seaside was being fronted by Apache, the rewrite rule could be put
>> into the Apache config, so it isn't a problem there either.
>>
>> But if I am using the latest version of Comanche?
>>
>> Is there a standard way to do this using Comanche/Seaside?
>
> Can't you just select home as default entry point?
>
> Philippe

It already is.  But that means somebody will need to put
"http://www.mylocalhost.com/seaside/home" as the URL in their browser.  
If they just put "http://www.mylocalhost.com" in their browser, they get
nothing.

Nevin

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Kom redirect

Yanni Chiu
Nevin Pratt wrote:
> Philippe Marschall wrote:
>> Can't you just select home as default entry point?
>
> It already is.  But that means somebody will need to put
> "http://www.mylocalhost.com/seaside/home" as the URL in their browser.  
> If they just put "http://www.mylocalhost.com" in their browser, they get
> nothing.

In the newer versions of Seaside (IIRC you're at 2.3, 2.5 or something),
the config app. has a setting for "default entry point". That's what
Phillppe is talking about. If you set the default entry point, then
that's where http://www.mylocalhost.com will take the user.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Kom redirect

Brad Fuller
Yanni Chiu wrote:

> Nevin Pratt wrote:
>> Philippe Marschall wrote:
>>> Can't you just select home as default entry point?
>>
>> It already is.  But that means somebody will need to put
>> "http://www.mylocalhost.com/seaside/home" as the URL in their
>> browser.  If they just put "http://www.mylocalhost.com" in their
>> browser, they get nothing.
>
> In the newer versions of Seaside (IIRC you're at 2.3, 2.5 or something),
> the config app. has a setting for "default entry point". That's what
> Phillppe is talking about. If you set the default entry point, then
> that's where http://www.mylocalhost.com will take the user.
I don't see "default entry point" as an option. There are items such as:
Base Path
Resource Base Url
Server Hostname

Do you mean one of these?

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Kom redirect

Philippe Marschall
2006/11/2, Brad Fuller <[hidden email]>:

> Yanni Chiu wrote:
> > Nevin Pratt wrote:
> >> Philippe Marschall wrote:
> >>> Can't you just select home as default entry point?
> >>
> >> It already is.  But that means somebody will need to put
> >> "http://www.mylocalhost.com/seaside/home" as the URL in their
> >> browser.  If they just put "http://www.mylocalhost.com" in their
> >> browser, they get nothing.
> >
> > In the newer versions of Seaside (IIRC you're at 2.3, 2.5 or something),
> > the config app. has a setting for "default entry point". That's what
> > Phillppe is talking about. If you set the default entry point, then
> > that's where http://www.mylocalhost.com will take the user.
> I don't see "default entry point" as an option. There are items such as:
> Base Path
> Resource Base Url
> Server Hostname
>
> Do you mean one of these?

The the config application before your configure your application.

Philippe
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Kom redirect

Brad Fuller
Philippe Marschall wrote:

> 2006/11/2, Brad Fuller <[hidden email]>:
>> Yanni Chiu wrote:
>> > Nevin Pratt wrote:
>> >> Philippe Marschall wrote:
>> >>> Can't you just select home as default entry point?
>> >>
>> >> It already is.  But that means somebody will need to put
>> >> "http://www.mylocalhost.com/seaside/home" as the URL in their
>> >> browser.  If they just put "http://www.mylocalhost.com" in their
>> >> browser, they get nothing.
>> >
>> > In the newer versions of Seaside (IIRC you're at 2.3, 2.5 or
>> something),
>> > the config app. has a setting for "default entry point". That's what
>> > Phillppe is talking about. If you set the default entry point, then
>> > that's where http://www.mylocalhost.com will take the user.
>> I don't see "default entry point" as an option. There are items such as:
>> Base Path
>> Resource Base Url
>> Server Hostname
>>
>> Do you mean one of these?
>
> The the config application before your configure your application.
ah... I set that. But, that doesn't seem to do anything. I still have to
type in:
www.domain.com/seaside/application_name

Do I have to do something else?
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Kom redirect

Brad Fuller
In reply to this post by Philippe Marschall
Philippe Marschall wrote:

> 2006/11/2, Brad Fuller <[hidden email]>:
>> Yanni Chiu wrote:
>> > Nevin Pratt wrote:
>> >> Philippe Marschall wrote:
>> >>> Can't you just select home as default entry point?
>> >>
>> >> It already is.  But that means somebody will need to put
>> >> "http://www.mylocalhost.com/seaside/home" as the URL in their
>> >> browser.  If they just put "http://www.mylocalhost.com" in their
>> >> browser, they get nothing.
>> >
>> > In the newer versions of Seaside (IIRC you're at 2.3, 2.5 or
>> something),
>> > the config app. has a setting for "default entry point". That's what
>> > Phillppe is talking about. If you set the default entry point, then
>> > that's where http://www.mylocalhost.com will take the user.
>> I don't see "default entry point" as an option. There are items such as:
>> Base Path
>> Resource Base Url
>> Server Hostname
>>
>> Do you mean one of these?
>
> The the config application before your configure your application.
seasidehosting.st FAQ says:
"To make your application accessible from the root, select it as default
entry point on the Seaside configuration page and set the base-path of
the application to "/". Note that this only works with recent versions
of Seaside."

what is the latest, or exact, version needed for this to work?

brad
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Kom redirect

Brad Fuller
Brad Fuller wrote:

> Philippe Marschall wrote:
>  
>> 2006/11/2, Brad Fuller <[hidden email]>:
>>    
>>> Yanni Chiu wrote:
>>>      
>>>> Nevin Pratt wrote:
>>>>        
>>>>> Philippe Marschall wrote:
>>>>>          
>>>>>> Can't you just select home as default entry point?
>>>>>>            
>>>>> It already is.  But that means somebody will need to put
>>>>> "http://www.mylocalhost.com/seaside/home" as the URL in their
>>>>> browser.  If they just put "http://www.mylocalhost.com" in their
>>>>> browser, they get nothing.
>>>>>          
>>>> In the newer versions of Seaside (IIRC you're at 2.3, 2.5 or
>>>>        
>>> something),
>>>      
>>>> the config app. has a setting for "default entry point". That's what
>>>> Phillppe is talking about. If you set the default entry point, then
>>>> that's where http://www.mylocalhost.com will take the user.
>>>>        
>>> I don't see "default entry point" as an option. There are items such as:
>>> Base Path
>>> Resource Base Url
>>> Server Hostname
>>>
>>> Do you mean one of these?
>>>      
>> The the config application before your configure your application.
>>    
> seasidehosting.st FAQ says:
> "To make your application accessible from the root, select it as default
> entry point on the Seaside configuration page and set the base-path of
> the application to "/". Note that this only works with recent versions
> of Seaside."
>
> what is the latest, or exact, version needed for this to work?
>  
we are trying to get squeakfoundation pier running and not being able to
point it correctly from the seaside application. The version is running
is Seaside2.6b1-lr.50.
is that sufficient?
I've set the items as stated above, but still get the Error: "/" not found.

thanks for any help!

brad
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Kom redirect

Nevin Pratt

seasidehosting.st FAQ says:
"To make your application accessible from the root, select it as default
entry point on the Seaside configuration page and set the base-path of
the application to "/". Note that this only works with recent versions
of Seaside."

what is the latest, or exact, version needed for this to work?
  
    
we are trying to get squeakfoundation pier running and not being able to
point it correctly from the seaside application. The version is running
is Seaside2.6b1-lr.50.
is that sufficient?
I've set the items as stated above, but still get the Error: "/" not found.

thanks for any help!

brad
  

I finally just did what I have always done with earlier versions of Comanche/Seaside.  I subclassed WAKom and implemented #process: as follows

process: aRequest
    aRequest url = '/'
        ifTrue: [aRequest url: '/seaside/home'].
    ^ super process: aRequest

Nevin

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Kom redirect

Brad Fuller
Nevin Pratt wrote:

>
>>> seasidehosting.st FAQ says:
>>> "To make your application accessible from the root, select it as default
>>> entry point on the Seaside configuration page and set the base-path of
>>> the application to "/". Note that this only works with recent versions
>>> of Seaside."
>>>
>>> what is the latest, or exact, version needed for this to work?
>>>  
>>>    
>> we are trying to get squeakfoundation pier running and not being able to
>> point it correctly from the seaside application. The version is running
>> is Seaside2.6b1-lr.50.
>> is that sufficient?
>> I've set the items as stated above, but still get the Error: "/" not found.
>>
>> thanks for any help!
>>
>> brad
>>  
>
> I finally just did what I have always done with earlier versions of
> Comanche/Seaside.  I subclassed WAKom and implemented #process: as follows
>
> process: aRequest
>     aRequest url = '/'
>         ifTrue: [aRequest url: '/seaside/home'].
>     ^ super process: aRequest
>
Thanks Nevin. I'll try this out!

brad
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Kom redirect

Brad Fuller
In reply to this post by Nevin Pratt
Nevin Pratt wrote:

>
>>> seasidehosting.st FAQ says:
>>> "To make your application accessible from the root, select it as default
>>> entry point on the Seaside configuration page and set the base-path of
>>> the application to "/". Note that this only works with recent versions
>>> of Seaside."
>>>
>>> what is the latest, or exact, version needed for this to work?
>>>  
>>>    
>> we are trying to get squeakfoundation pier running and not being able to
>> point it correctly from the seaside application. The version is running
>> is Seaside2.6b1-lr.50.
>> is that sufficient?
>> I've set the items as stated above, but still get the Error: "/" not found.
>>
>> thanks for any help!
>>
>> brad
>>  
>
> I finally just did what I have always done with earlier versions of
> Comanche/Seaside.  I subclassed WAKom and implemented #process: as follows
>
> process: aRequest
>     aRequest url = '/'
>         ifTrue: [aRequest url: '/seaside/home'].
>     ^ super process: aRequest
>
> Nevin
so, this appends the '/seaside/home' to every link there after, yes?
Anyway around this?

Alternatively, I'd just like to get the suggestion from the
seasidehosting.st FAQ (above) working. Can anyone help?

brad
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Kom redirect

Yanni Chiu
Brad Fuller wrote:
> Alternatively, I'd just like to get the suggestion from the
> seasidehosting.st FAQ (above) working. Can anyone help?

Have you tried in a clean, Seaside-only, image?
Maybe some other package you've got loaded is
interfering.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Kom redirect

Brad Fuller
Yanni Chiu wrote:
> Brad Fuller wrote:
>> Alternatively, I'd just like to get the suggestion from the
>> seasidehosting.st FAQ (above) working. Can anyone help?
>
> Have you tried in a clean, Seaside-only, image?
> Maybe some other package you've got loaded is
> interfering.
Hmmm... It's 3.8 with seaside and pier. Could pier do this?

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Re: Kom redirect

Brad Fuller
In reply to this post by Brad Fuller
Brad Fuller wrote:
> seasidehosting.st FAQ says:
> "To make your application accessible from the root, select it as default
> entry point on the Seaside configuration page and set the base-path of
> the application to "/". Note that this only works with recent versions
> of Seaside."
>
> what is the latest, or exact, version needed for this to work?

There seems to a few additional steps besides setting the 'default entry
point' and the 'base-path', as mentioned in the seasidehosting FAQ. I'm
just reporting what Ken has found and changed. Perhaps the following
method change should be considered for the generic Pier image:


---
Change PRPierMain to:

structureFrom: aRequest
    | path |
    path := aRequest url findTokens: $/.
    path ifNotEmpty: [
        path removeFirst = self dispatcher name
            ifFalse: [ self error: 'Invalid Seaside dispatcher
configuration' ]].
    (path notEmpty
        and: [ path first = self application name
        or: [ path first = (self dispatcher entryPoints keyAtValue: self
application ifAbsent: [ nil ]) ] ])
            ifTrue: [ path removeFirst ].
    path := path
        inject: String new
        into: [ :result :each | result , '/' , each ].
    ^ PRPathLookup
        start: self kernel root path: path
        onError: [ self kernel root ]

--
To start the service:

h := (HttpService on: 80 named: 'seaside')
    plug: (WAKom entryPoint:
            (WADispatcher default basePath: '')).
h start.

---
To stop the service:

(HttpService servicesNamed: 'seaside') do: [ :s | s stop ]

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Kom redirect

Yanni Chiu
In reply to this post by Brad Fuller
Brad Fuller wrote:
>>>Alternatively, I'd just like to get the suggestion from the
>>>seasidehosting.st FAQ (above) working. Can anyone help?
>>
>>Have you tried in a clean, Seaside-only, image?
>>Maybe some other package you've got loaded is
>>interfering.
>
> Hmmm... It's 3.8 with seaside and pier. Could pier do this?

I just had to look more closely. It seems to me that
seasidehosting is doing something extra in the image
or in its Apache config. The code in:

    WADispatcher>>handlerForRequest: aRequest relativeTo: base

works if the the basePath of WADispatcher is set
to '/'. But that is not what I want to do, since I still
want the '/seaside' there for redirect/rewrite.

The solution I have is to add:

     RedirectMatch ^$ http://foo.com/seaside/
     RedirectMatch ^/$ http://foo.com/seaside/

to my Apache config. Note that this is equivalent
to Nevin's image change:
     aRequest url = '/' ifTrue: [aRequest url: '/seaside/home'].

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside