httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Warhurst, SI (Spencer) " <S.I.Warhu...@rl.ac.uk>
Subject RE: [users@httpd] Aliases
Date Wed, 19 Feb 2003 15:10:23 GMT
> >-----Original Message-----
> >From: Warhurst, SI (Spencer) [mailto:S.I.Warhurst@rl.ac.uk]
> >
> >Alias /mailinglistname "d:/www/lists/mailinglistname.html"
> >Alias /mailinglistname/ "d:/www/lists/mailinglistname.html"
> >Alias /MAILINGLISTNAME "d:/www/lists/mailinglistname.html"
> >Alias /MAILINGLISTNAME/ "d:/www/lists/mailinglistname.html"
> 
> PS If your mailinglist names have some consistent 
> nomenclature then you
> can combine them all into one rewrite rule, e.g.
> 
> If you have:
> 
> /mlist_apple -> "d:/www/lists/mlist_apple.html"
> /mlist_banana -> "d:/www/lists/mlist_banana.html"
> /mlist_orange -> "d:/www/lists/mlist_orange.html" etc.
> 
> then:
> 
> 	# First get rid of trailing slash, if it exists.
> 	RewriteRule /mlist_(.*)/ /mlist_$1
> 
> 	# Main RewriteRule
> 	RewriteRule /mlist_(.*) "d:/www/lists/mlist_$1.html"
> 
> will get them all.

I've been meaning to get to grips with RewriteRule.

List names can contain alphanumeric characters and "_" and "-". So, would
this work:

  # First get rid of trailing slash, if it exists.
  RewriteRule /(.*)/ /$1

  # Main RewriteRule
  RewriteRule /(.*) "d:/www/lists/$1.html"

For that matter, could you combine those two lines like this:

  RewriteRule /(.*)\/* "d:/www/lists/$1.html"

Thanks
Spencer


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message