[thelist] Regexp help

Matt Warden mwarden at gmail.com
Wed Jan 26 09:28:17 CST 2005


Razvan,

On Wed, 26 Jan 2005 16:39:51 +0200, Razvan Pop <razvan at cpea.ro> wrote:
> Hello,
>     RewriteRule ^/([a-zA-Z]+)$ /default.php?sLinkCat=$1 [L]

What is an example URL that you are trying to match? What does the
rewrite log day? What does the error_log say?

Off-hand, you might want to try escaping the slash (often reg ex's are
delimited by that type of slash, and even that doesn't apply to
rewrites, it might still be considered a special character):

RewriteRule ^\/([a-zA-Z]+)$ /default.php?sLinkCat=$1 [L]

or, a somewhat simplified equivalent (IMO, anyway):

RewriteRule ^\/([a-z]+)$ /default.php?sLinkCat=$1 [NC,L]

Note that if your original URI had a querystring, you aren't going to
get it unless you specify that you want it:

RewriteRule ^\/([a-z]+)$ /default.php?sLinkCat=$1 [NC,QSA,L]

Hope this helps,

-- 
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.


More information about the thelist mailing list