I wish to a rewrite rule so that if your user would go to the URL example.org/stuff/junk.jpg the rule will process and finish up at re-writer.php but when the consumer would go to example.org/stuff/hackingisawesome/junk.jpg the rule won't be triggered and they'll obtain a standard 404 (or perhaps a page, if a person should exist).

I can not tell, in line with the environment variables, if this sounds like possible without some fairly fancy regex.

The same is true anybody are conscious of either:

a) a means this really is already included in the mod_rewrite syntax, or

b) a great, reliable method of handling this with regular expressions?

Links to documentation or lessons welcome. I am and feel unaware on what to do next.

Oh, and I know the methods I possibly could only have the script the rule redirects to merely provide the 404, but I'd rather just use the rule once the conditions exist.

Do this:

RewriteRule ^stuff/[^/]+$ re-writer.php

This can rewrite all demands to /stuff/… with just one additional path segment to re-author.php.