You need to surround your regex with delimiters - usually something like /myregex/
If you leave off the delimiters you get this error. You could try
if(preg_match($file,"|".$_SERVER['REQUEST_URI']."|")) {
Since |
is a legitimate delimiter, and may not be used in a legal URL
Having said that - regex is a powerful tool, and if you are looking for a verbatim match it may be overkill. Furthermore, a URL could have all kinds of characters in it that have special meaning in regex - which would actually cause a false match. For example, .
in a regex means "any character", so apple.com
will match applescom
which is probably not what you want.