Names inside filenames aren't considered for rewrite
Names inside filenames aren't considered for rewrite
I'm trying to rewrite every request which isn't an existing file or directory to end up in a couple of $_GET sub-arrays for dispatcher.php to use. So far, everything seems to work nicely except trying to request pages which name is part of a file name. For example: I have a file named article.tpl.php. When I make a request for http://example.com/article , instead of rewriting it to /dispatcher.php?request=article¶ms= like it's supposed to, Apache renders a 404. It doesn't matter if after article there is a slash or not. Even if there's an entire string behind that slash. To be clear: everything works as long as I'm requesting existing files/folders, or making requests of which the names are totally unrelated to the files in the root folder. Rewrite rules: RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^([-\w]*)(/[A-Za-z0-9-/]*)?$ dispatcher.php?request=$1¶ms=$2 This should rewrite all requests for non-existing files and folders which match with one of these possible patterns: / /word /word-with-hyphens /some-word/ /some-word/with/some/junk/following/it/it-doesnt-matter-how/long/this-is/5/1/25 PS: I've also asked this question on superuser.com, so far without response. Link .