Sorry for the noise! I Just realized that the $options array is passes by reference to custom_url_rewrite_outbound as well. This means the correct code looks like this:<div><br></div><div><div>function custom_url_rewrite_outbound(&amp;$path, &amp;$options, $original_path) {</div>
<div>    if (isset($_GET[&#39;iframe&#39;]) &amp;&amp; &#39;on&#39;==$_GET[&#39;iframe&#39;]) {</div><div>        $options[&#39;query&#39;] .= (strlen($options[&#39;query&#39;])&gt;0 ? &#39;?&#39; : &#39;&#39;) . &#39;iframe=on&#39;;</div>
<div>    }</div><div>}</div><div><br></div><div>Regards</div><div>Ernst</div><div><br></div><br><div class="gmail_quote">2010/11/19 Ernst Plüss <span dir="ltr">&lt;<a href="mailto:ernst.pluess@gmail.com">ernst.pluess@gmail.com</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi Drupalfriends<div><br></div><div>I&#39;d like to add a query string to every url. If the URL is &#39;/node/234&#39; it should change to &#39;/node/234&amp;iframe=on&#39;.</div>
<div><br></div><div>I found the custom_url_rewrite_outbound function and added it to my settings.php:</div>
<div><br></div><div><div>    if (isset($_GET[&#39;iframe&#39;]) &amp;&amp; &#39;on&#39;==$_GET[&#39;iframe&#39;]) {</div><div>        $path .= (strpos($path, &#39;?&#39;) !== FALSE ? &#39;&amp;&#39; : &#39;?&#39;) . &#39;iframe=on&#39;;</div>

<div>    }</div></div><div><br></div><div>This works fine, but the url() method, which calls custom_url_rewrite_outbound runns $path through drupal_urlencode() afterwards. This means the url changes to  &#39;/node/234%3Fiframe%3Don&#39; which obviously does not work.</div>

<div><br></div><div>Am I doing something wrong or is there another way of getting this to work?</div><div><br></div><div>Regards</div><div>Ernst</div><font color="#888888"><div><br></div>
</font></blockquote></div><br></div>