You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by ___cliff rayman___ <cl...@genwax.com> on 2000/06/01 02:24:49 UTC

Re: %udat persistence problem...S.O.S.

you might want to try:

my $therequest=$r->the_request;
my($host,$uri) = $therequest=~m!http://([^/]+)(.*))!;
unless($host=~m!xyz\.com!){
   $r->content_type('text/html');
   $r->header_out(Location => "http://www.xyz.com$uri");
   return REDIRECT;
}

you can probably also get mod_rewrite to do this for you very easily as
well.


--
___cliff rayman___www.genwax.com___cliff@genwax.com___

"Hello!" wrote:

> sirs, i met a problem on EMBPERL_COOKIE_DOMAIN, which i set it to
> "xyz.com" for example. the IP address of my www.xyz.com is
> 123.99.88.77. %udat fails to be persistent if the URL entered in
> browser's Location box is http://123.99.88.77, very possibly because
> the domain part is "99.88.77" which is different from "xyz.com" i set
> for EMBPERL_COOKIE_DOMAIN so that the browser won't return the cookie
> EMBPERL_UID. i uncomment PerlSetEnv EMBPERL_COOKIE_DOMAIN but it still
> not work. or, how can i know entered URL is 123.99.88.77 (not
> SERVER_NAME) so that i can redirect the browser to www.xyz.com? is
> there any elegant remedy for such kind of user
> ignorance? thanks.huang-ming
>
>      ----- Original Message -----
>      From: Gerald Richter
>      To: Hello ; Embperl@Perl. Apache. Org
>      Sent: Friday, May 12, 2000 2:04 PM
>      Subject: RE: %udat persistence problem...S.O.S.
>
>
>            I'm sorry I didn't read the mailing list, because
>           I don't know how to get the list.
>
>      Look at
>      http://perl.apache.org/embperl/Embperl.pod.15.html#Feedback_and_Bug_ReportsGerald
>
>
>





Re: %udat persistence problem...S.O.S.

Posted by Hello <pa...@ksts.seed.net.tw>.
never mind.

i turned to $req_rec->hostname() and it finally returned what i wanted, 123.99.88.77. 

related API document can be found on the book, "Writing Apache modules with Perl and C".

thanks anyway.

huang-ming

----- Original Message ----- 
From: ___cliff rayman___ <cl...@genwax.com>
To: Hello <pa...@ksts.seed.net.tw>; <mo...@apache.org>
Sent: Thursday, June 01, 2000 10:47 AM
Subject: Re: %udat persistence problem...S.O.S.


> your right - sorry.
> i hadn't tried it - i was reading Apache Modules and did not
> read it correctly.
> i also tried variations of Apache::URI parse to get a hostname,
> but that did not seem to work on my development server.  it is
> back several revs however.
> cliff
> 
> Hello wrote:
> 
> > thanks a lot. but, does the_request() contain the host part (ie.
> > 123.99.88.77 for my case) of entered URL? it seems to contain only
> > method, uri, and protocol only. huang-ming----- Original Message
> > -----From: ___cliff rayman___ <cl...@genwax.com>To: Hello!
> > <pa...@ksts.seed.net.tw>; <mo...@apache.org>Sent: Thursday, June
> > 01, 2000 8:24 AMSubject: Re: %udat persistence problem...S.O.S. > you
> > might want to try:
> > >
> > > my $therequest=$r->the_request;
> > > my($host,$uri) = $therequest=~m!http://([^/]+)(.*))!;
> > > unless($host=~m!xyz\.com!){
> > >    $r->content_type('text/html');
> > >    $r->header_out(Location => "http://www.xyz.com$uri");
> > >    return REDIRECT;
> > > }
> > >
> > > you can probably also get mod_rewrite to do this for you very easily
> > as
> > > well.
> > >
> > >
> > > --
> > > ___cliff rayman___www.genwax.com___cliff@genwax.com___
> > >
> > > "Hello!" wrote:
> > >
> > > > sirs, i met a problem on EMBPERL_COOKIE_DOMAIN, which i set it to
> > > > "xyz.com" for example. the IP address of my www.xyz.com is
> > > > 123.99.88.77. %udat fails to be persistent if the URL entered in
> > > > browser's Location box is http://123.99.88.77, very possibly
> > because
> > > > the domain part is "99.88.77" which is different from "xyz.com" i
> > set
> > > > for EMBPERL_COOKIE_DOMAIN so that the browser won't return the
> > cookie
> > > > EMBPERL_UID. i uncomment PerlSetEnv EMBPERL_COOKIE_DOMAIN but it
> > still
> > > > not work. or, how can i know entered URL is 123.99.88.77 (not
> > > > SERVER_NAME) so that i can redirect the browser to www.xyz.com? is
> >
> > > > there any elegant remedy for such kind of user
> > > > ignorance? thanks.huang-ming
> > > >
> > > >      ----- Original Message -----
> > > >      From: Gerald Richter
> > > >      To: Hello ; Embperl@Perl. Apache. Org
> > > >      Sent: Friday, May 12, 2000 2:04 PM
> > > >      Subject: RE: %udat persistence problem...S.O.S.
> > > >
> > > >
> > > >            I'm sorry I didn't read the mailing list, because
> > > >           I don't know how to get the list.
> > > >
> > > >      Look at
> > > >
> > http://perl.apache.org/embperl/Embperl.pod.15.html#Feedback_and_Bug_ReportsGerald
> >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> 
> --
> ___cliff rayman___www.genwax.com___cliff@genwax.com___
> 
> 
> 

Re: %udat persistence problem...S.O.S.

Posted by ___cliff rayman___ <cl...@genwax.com>.
your right - sorry.
i hadn't tried it - i was reading Apache Modules and did not
read it correctly.
i also tried variations of Apache::URI parse to get a hostname,
but that did not seem to work on my development server.  it is
back several revs however.
cliff

Hello wrote:

> thanks a lot. but, does the_request() contain the host part (ie.
> 123.99.88.77 for my case) of entered URL? it seems to contain only
> method, uri, and protocol only. huang-ming----- Original Message
> -----From: ___cliff rayman___ <cl...@genwax.com>To: Hello!
> <pa...@ksts.seed.net.tw>; <mo...@apache.org>Sent: Thursday, June
> 01, 2000 8:24 AMSubject: Re: %udat persistence problem...S.O.S. > you
> might want to try:
> >
> > my $therequest=$r->the_request;
> > my($host,$uri) = $therequest=~m!http://([^/]+)(.*))!;
> > unless($host=~m!xyz\.com!){
> >    $r->content_type('text/html');
> >    $r->header_out(Location => "http://www.xyz.com$uri");
> >    return REDIRECT;
> > }
> >
> > you can probably also get mod_rewrite to do this for you very easily
> as
> > well.
> >
> >
> > --
> > ___cliff rayman___www.genwax.com___cliff@genwax.com___
> >
> > "Hello!" wrote:
> >
> > > sirs, i met a problem on EMBPERL_COOKIE_DOMAIN, which i set it to
> > > "xyz.com" for example. the IP address of my www.xyz.com is
> > > 123.99.88.77. %udat fails to be persistent if the URL entered in
> > > browser's Location box is http://123.99.88.77, very possibly
> because
> > > the domain part is "99.88.77" which is different from "xyz.com" i
> set
> > > for EMBPERL_COOKIE_DOMAIN so that the browser won't return the
> cookie
> > > EMBPERL_UID. i uncomment PerlSetEnv EMBPERL_COOKIE_DOMAIN but it
> still
> > > not work. or, how can i know entered URL is 123.99.88.77 (not
> > > SERVER_NAME) so that i can redirect the browser to www.xyz.com? is
>
> > > there any elegant remedy for such kind of user
> > > ignorance? thanks.huang-ming
> > >
> > >      ----- Original Message -----
> > >      From: Gerald Richter
> > >      To: Hello ; Embperl@Perl. Apache. Org
> > >      Sent: Friday, May 12, 2000 2:04 PM
> > >      Subject: RE: %udat persistence problem...S.O.S.
> > >
> > >
> > >            I'm sorry I didn't read the mailing list, because
> > >           I don't know how to get the list.
> > >
> > >      Look at
> > >
> http://perl.apache.org/embperl/Embperl.pod.15.html#Feedback_and_Bug_ReportsGerald
>
> > >
> > >
> > >
> >
> >
> >
> >
> >

--
___cliff rayman___www.genwax.com___cliff@genwax.com___



Re: %udat persistence problem...S.O.S.

Posted by Hello <pa...@ksts.seed.net.tw>.
thanks a lot.

but, does the_request() contain the host part (ie. 123.99.88.77 for my case) of entered URL? it seems to contain only method, uri, and protocol only.

huang-ming
----- Original Message ----- 
From: ___cliff rayman___ <cl...@genwax.com>
To: Hello! <pa...@ksts.seed.net.tw>; <mo...@apache.org>
Sent: Thursday, June 01, 2000 8:24 AM
Subject: Re: %udat persistence problem...S.O.S.


> you might want to try:
> 
> my $therequest=$r->the_request;
> my($host,$uri) = $therequest=~m!http://([^/]+)(.*))!;
> unless($host=~m!xyz\.com!){
>    $r->content_type('text/html');
>    $r->header_out(Location => "http://www.xyz.com$uri");
>    return REDIRECT;
> }
> 
> you can probably also get mod_rewrite to do this for you very easily as
> well.
> 
> 
> --
> ___cliff rayman___www.genwax.com___cliff@genwax.com___
> 
> "Hello!" wrote:
> 
> > sirs, i met a problem on EMBPERL_COOKIE_DOMAIN, which i set it to
> > "xyz.com" for example. the IP address of my www.xyz.com is
> > 123.99.88.77. %udat fails to be persistent if the URL entered in
> > browser's Location box is http://123.99.88.77, very possibly because
> > the domain part is "99.88.77" which is different from "xyz.com" i set
> > for EMBPERL_COOKIE_DOMAIN so that the browser won't return the cookie
> > EMBPERL_UID. i uncomment PerlSetEnv EMBPERL_COOKIE_DOMAIN but it still
> > not work. or, how can i know entered URL is 123.99.88.77 (not
> > SERVER_NAME) so that i can redirect the browser to www.xyz.com? is
> > there any elegant remedy for such kind of user
> > ignorance? thanks.huang-ming
> >
> >      ----- Original Message -----
> >      From: Gerald Richter
> >      To: Hello ; Embperl@Perl. Apache. Org
> >      Sent: Friday, May 12, 2000 2:04 PM
> >      Subject: RE: %udat persistence problem...S.O.S.
> >
> >
> >            I'm sorry I didn't read the mailing list, because
> >           I don't know how to get the list.
> >
> >      Look at
> >      http://perl.apache.org/embperl/Embperl.pod.15.html#Feedback_and_Bug_ReportsGerald
> >
> >
> >
> 
> 
> 
> 
>