httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Slive <jsl...@gmail.com>
Subject Re: [users@httpd] Mod_rewrite regular expression help
Date Fri, 29 Oct 2004 17:47:03 GMT
On Fri, 29 Oct 2004 13:23:26 -0400, Tod Thomas <tthomas@chubb.com> wrote:
> I need to use a regex to filter a URL.  The URL will be in the following
> format:
> 
> http://host.domain.com/dept/tst123abc.html
> 
> - The URL will always begin with: http://host.domain.com/dept/tst
> - followed by at least 1 or more digits
> - followed by a '.'
> - followed by any number of letters (the file extension).

> I need to redirect any requests that *don't* fit the above
> regex rules to another default page.

Thanks for your clear explanation.  Usually people think we can read
their minds.

You want something like
RewriteRule !^/dept/tst[0-9]+\.[a-zA-Z]+$ /path/to/default/page

Joshua.

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