httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Kew <n...@webthing.com>
Subject Re: [users@httpd] Conditional RewriteRule
Date Mon, 24 May 2004 17:14:06 GMT
On Mon, 24 May 2004, Rick wrote:

> This is a question about using conditions in mod_rewrite.

No it isn't.  It's a question about a task, for which one possible
solution might be using conditions in mod_rewrite.

>   This was designed to be filesystem-friendly, with a maximum of 100 pages
>   per directory.

If you're on a modern operating system such as Linux, you may have been
doing a lot of work for nothing.  The kind of scheme you describe is only
really necessary if your filesystem uses linear search.  Putting your
data on an appropriate filesystem solves that instantly.

> But our canonical URLs must be of the form /widgets/<ID_NUMBER>.html
> eg: we need to rewrite /widgets/1234.html to /widgets/0/0/1/2/1234.html

Stated like that, mod_alias appears to be a simpler (and probably faster)
solution than mod_rewrite.  But I'm not sure you really sure how to
do it in a single regexp: httpd.conf is not Perl (unless ....).
The basic syntax would be the same with AliasMatch as with RewriteRule.

Oh, and even in Perl, a single regexp is probably slower than two simple
ones here, unless you can do it without /e.

-- 
Nick Kew

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