Check first that $_SERVER['REQUEST_URI'] isset and is not empty