Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: mod_rewrite + CGI.pm in "reverse"?

by cleverett (Friar)
on Mar 11, 2005 at 19:05 UTC ( [id://438753]=note: print w/replies, xml ) Need Help??


in reply to mod_rewrite + CGI.pm in "reverse"?

I use mod_rewrite a a fair amount, and for something like this, I'd do:
RewriteRule ^/(news|ftp|http)/([^/]+)/([\d]+)$ \ /index.pl?type=$1&feed=$1://$2&limit=$3

I could be wrong about this, but the reason in my mind for using this little bit of voodoo is that .* will match from the second character to the end of the uri, leaving $2 and $3 undefined. ([^/]+)/([^/]+) is analogous to using (\w+)\W+(\w+) to pick out 2 series of non-spaces bracketing a length of whitespace.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://438753]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (2)
As of 2024-04-19 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found