httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <>
Subject Re: [users@httpd] mod_rewrite help
Date Mon, 07 Sep 2009 12:20:50 GMT
On Mon, Sep 7, 2009 at 8:08 AM, Lars<> wrote:
> Hello list!
> I know basic mod_rewrite, not much, but enough to create basic rules.
> Now I need to create a rule that can handle this situation:
>  * Work under the root (/) folder
>  * Don't do anything under the /secure/ folder
>  * Don't do anything with *.js, *.jpg
>  * Rewrite everything else to index.php?bad_request=%URL%

this is probably close:

RewriteCond %{REQUEST_URI} !^/secure/
RewriteCond %{REQUEST_URI} ! \.(js|jpg)$
RewriteCond %{QUERY_STRING} !bad_request
RewriteRule (.*) /index.php?bad_request=$1

"If it doesn't begin with /secure, end in js/jpg, or is already
rewritten as a bad request, rewrite it."

Eric Covener

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message