[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



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...

-- 
\ Chris Johnson           \ 
 \ cej [at] nightwolf.org.uk    ~-----,   
  \ http://cej.nightwolf.org.uk/  ~-----------------------------------, 
   \ Redclaw chat - http://redclaw.org.uk - telnet redclaw.org.uk 2000 \____

___________________________________________________________________

Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html

  GNU the choice of a complete generation.