The preg_match below is supposed to find matches in $_SERVER['request_uri'] that look like a directory, i.e /test-page/, but it always returns false/0. What's the problem? The same test works on http://www.functions-online.com/preg_match.html. preg_match($_SERVER['REQUEST_URI'],'/^\/([a-z0-9-_]+)\//') PHP: