#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    349
    Rep Power
    12

    Rewrite items that do NOT match


    I want to rewrite everything that does NOT match my pattern.

    My code rewrites matches but I want to rewrite everything that does NOT match.

    This is in my .htaccess file:

    Code:
    RewriteEngine On
    RewriteRule ^(\w+)/(\d+)/(\w+)/(\w+)/(\d+)/(\w+)/(\w+)/(\d+)\.(pdf|doc)$ image.png [L]
  2. #2
  3. Transforming Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    14,122
    Rep Power
    9398
    Take a close look at the documentation for RewriteRule. There's a comment in there about how to negate an expression.

IMN logo majestic logo threadwatch logo seochat tools logo