Prevent empty string on query if viewing root
<p>I use the following for getting the current URL in PHP:</p>

<pre><code>$pageURL = $_SERVER["REQUEST_URI"];

return $pageURL;
</code></pre>

<p>This is used in my links to create e.g <code>/login?continue=/page/i/want</code></p>

<p>However when I'm viewing the home page I will get <code>/login?continue=</code> how do I force it to become <code>/login?continue=/</code> when viewing the home page??</p>

<p>I tried this:</p>

<pre><code>if($pageURL == '')
    $pageURL = '/';
</code></pre>

<p>but that didn't force the query string :/</p>

<p>Any ideas? Thanks</p>
