Re: Re: Regex help
| From: | Per Jessen | Date: | Tue, 09 Sep 2008 13:09:01 +0000 |
| Subject: | Re: Re: Regex help | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279726@lists.php.net to get a copy of this message | ||
Jason Pruim wrote:
>
> On Sep 9, 2008, at 4:38 PM, Nathan Rixham wrote:
>
>> Jason Pruim wrote:
>>> Hey everyone,
>>> Not completely specific to php but I know you guys know regex's
>>> better then I do! :)
>>> I am attempting to match purl.schreurprinting.com/jasonpruim112 to
>>> purl.schreurprinting.com/p.php?purl=jasonpruim112
>>> Here are my current matching patterns:
>>> RewriteRule /(.*) "/volumes/raider/webserver/
>>> documents/dev/schreurprinting.com/p.php?purl=$
>>> # RewriteRule /(*.) "/purl.schreurprinting.com/$1"
>>> # RewriteRule /(mail.php?purl=*) "/
>>> purl.schreurprinting.com/mail.php?purl=$1"
>>> Yes I am doing this for apache's mod_rewrite, but my question is
>>> much more specific to regex's at this point :)
>>> Any ideas where I am going wrong? it seems like it should be fairly
>>> simple to do, but I don't know regex's at all :)
>>> --
>>> Jason Pruim
>>> Raoset Inc.
>>> Technology Manager
>>> MQC Specialist
>>> 11287 James St
>>> Holland, MI 49424
>>> www.raoset.com
>>> japruim@raoset.com
>>
>> RewriteRule ^jasonpruim112$ /p.php?purl=jasonpruim112 [L]
>
> Just tried it, and it pops up with a 404... I'll keep looking.
>
> One other thing that I should probably add is the fact that the
> ^jasonpruim112$ could have hundreds of counterparts.... ^bobsmith112$
> ^jerrybob112$ etc... etc...
>
Maybe this:
RewriteCond %{REQUEST_URI} !^/p\.php
RewriteRule ^/(.+)$ /p.php?purl=$1
/Per Jessen, Zürich