I have a few rewrite rules like these
RewriteRule ^dir/(.*)-something.html otherdir/file1.php?var1=val&var2=$1 [L,NC] RewriteRule ^dir/ otherdir/file2.php?var1=val [L,NC]
dir/ is not a real directory. Everything above works as expected.
However, the user is able to type anything like
And they are still redirected to file2.php. If the user types in just garbage I'd like to serve a 404 instead.
I'm guessing I need a RewiteCond that will test for blank space after the slash and only then serve file2.php, but I'm unsure how to write it.