On Mon, 2009-01-12 at 13:20 -0500, Jason Pruim wrote: > Hi Everyone, > > I know it's not a php question... But I know alot of you use rewrite > rules and regular expressions and so I thought maybe you would be > able to help me. > > The site: HTTP://purl.raoset.com/test112 > > test112 doesn't exist.. It's driven by the database using this > rewrite rule: > > RewriteCond %{REQUEST_FILENAME} !-f > RewriteCond %{REQUEST_FILENAME} !-d > RewriteRule . /p.php [L] > > Now, on that site I have a few links... right now the likes are in > the format of: > HTTP://purl.raoset.com/design.php?purl=test112 > > What I would like is to have it read: > HTTP://purl.raoset.com/test112/design > > completing the total look of the site :) > > I tried to modify this rewrite rule I found on the web: > RewriteRule ^(.+)\.pdf$ /cgi-bin/pdf-script.php?file=$1.pdf [L,NC,QSA] > > But no joy... What I had was: > RewriteRule ^design /design.php?purl=$1 [L] $1 refers to a captured part of the matched string. To capture you need to place parenthesis around the the portion of the regular expression that you want to capture. So you need something like: RewriteRule ^([^/]+)/([^/]+)$ /$2.php?purl=$1 [L] You need two captures because you have the first path fragment as the parameter value and the second apth fragment as the page name. Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php