You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Tracy12 <j_...@yahoo.com> on 2007/01/24 06:17:42 UTC

Retrieve Query String

In my mod_perl authentication module  I have the following to get the url
without the ticket parameter

          my $uri_parsed = $r->parsed_uri;
          my $unparsed = $uri_parsed->unparse();
          
but if the user hits the url as follows

http://localhost/test      it actually goes to
http://localhost/test/index.pl  because of the Directory index configuration
in my httpd.conf (e.g DirectoryIndex  index.pl)

When I print the $unparsed it gives http://localhost/test but How can I get
the entire url.





-- 
View this message in context: http://www.nabble.com/Retrieve-Query-String-tf3079246.html#a8555187
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: Retrieve Query String

Posted by Tracy12 <j_...@yahoo.com>.
what I meant was different thing, normally auth handlers got REDIRECT or may
be  HTTP_MOVED_TEMPORARILY.
where necessary.

in httpd we might have a <Location directive with  /test which might go to  
/test/index.pl  because of the above redirect $r->uri() or anyother thing
will say query string as /test which is quite right but 

I just want to know is there any way to get where client intended to go
which is /test/index.pl without hardcoding, reason in when everything ok
(where no REDIRECT ) the same print statement in auth handler prints URI as 
/test/index.pl, For some reason I want both to me similar (e.g CAS service
validate issue)

Thanks




Geoffrey Young wrote:
> 
> Tracy12 wrote:
>> In my mod_perl authentication module  I have the following to get the url
>> without the ticket parameter
>> 
>>           my $uri_parsed = $r->parsed_uri;
>>           my $unparsed = $uri_parsed->unparse();
>>           
>> but if the user hits the url as follows
>> 
>> http://localhost/test      it actually goes to
>> http://localhost/test/index.pl  because of the Directory index
>> configuration
>> in my httpd.conf (e.g DirectoryIndex  index.pl)
>> 
>> When I print the $unparsed it gives http://localhost/test but How can I
>> get
>> the entire url.
> 
> you probably want $r->uri().
> 
> at this point, it's probably worth reading a book (or three) on mod_perl
> - all the nuances of the API are well covered in any of the volumes here:
> 
>   http://perl.apache.org/docs/offsite/books.html
> 
> while all the existing books are biased toward mp1, once you understand
> the API and how mod_perl really works in general, porting the
> functionality to mp2 is pretty simple.
> 
> --Geoff
> 
> 

-- 
View this message in context: http://www.nabble.com/Retrieve-Query-String-tf3079246.html#a8577898
Sent from the mod_perl - General mailing list archive at Nabble.com.


Re: Retrieve Query String

Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Tracy12 wrote:
> In my mod_perl authentication module  I have the following to get the url
> without the ticket parameter
> 
>           my $uri_parsed = $r->parsed_uri;
>           my $unparsed = $uri_parsed->unparse();
>           
> but if the user hits the url as follows
> 
> http://localhost/test      it actually goes to
> http://localhost/test/index.pl  because of the Directory index configuration
> in my httpd.conf (e.g DirectoryIndex  index.pl)
> 
> When I print the $unparsed it gives http://localhost/test but How can I get
> the entire url.

you probably want $r->uri().

at this point, it's probably worth reading a book (or three) on mod_perl
- all the nuances of the API are well covered in any of the volumes here:

  http://perl.apache.org/docs/offsite/books.html

while all the existing books are biased toward mp1, once you understand
the API and how mod_perl really works in general, porting the
functionality to mp2 is pretty simple.

--Geoff