[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] Redirecting to a index page depending on group membership on Apache 1.3
From: "Chris J" <cej [at] nightwolf.org.uk>
To: <shef-lug [at] list.sheflug.org.uk>
Sent: Tuesday, August 26, 2003 8:51 PM
Subject: Re: [Sheflug] Redirecting to a index page depending on group
membership on Apache 1.3
>
> And Lo! The Great Prophet "Rob Keeling" uttered these words of wisdom:
> >
> > Now there`s a thought, 95% of our student usernames are prefixed 0-9 so
if I
> > could redirect
> > on if the first char of the user name is numeric, that would mean only a
> > very few users would even
> > see the links to the staff pages, and standard acls would stop them
being
> > used.
> >
> > would something like
> >
> > RewriteCond %{REMOTE_USER} ^[0-9]*$
> >
> > acheve this? I have really not got to grips with regular expressions
yet!
> >
>
> Err... ^[0-9].*$ ... would be what you are looking for. The '.' is
> important as '*' means match any number of the previous character pattern,
> which in your case is [0-9], thus you'd be looking for purely numeric
> usernames :) The '.' matches any character, thus the pattern '.*' matches
> any amount of any character. ^ and $ mean start and end of line.
>
> Chris...
Ah, right, I see what you mean, so following the same logic ^[a-z]*$ would
match
purely alpha usernames? Are these case sensitive? If so I assume there is
some sort of OR operator.
(Our staff account names are purely alpha, but mixed case.)
Neat things these regular expressions.....
Thanks
Rob Keeling
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.