[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-httpd-users
Subject:    Re: [users@httpd] Mod_rewrite regular expression help
From:       Joshua Slive <jslive () gmail ! com>
Date:       2004-10-29 17:47:03
Message-ID: e498c16604102910475b898cca () mail ! gmail ! com
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic