This assumes URL formats that may not hold -- the index.php may be rewritten away. This is why the Request::url function needs to be used to generate URLs.