$c-&gt;uri_for pulls it&#39;s base path from $c-&gt;req-&gt;base.&nbsp; Quoting the documentation in the code:<br>If your application was queried with the URI<br>C&lt;<a href="http://localhost:3000/some/path">http://localhost:3000/some/path</a>&gt; then C&lt;base&gt; is C&lt;<a href="http://localhost:3000/">http://localhost:3000/</a>&gt;.<br>
<br>So, setting $c-&gt;req-&gt;base to your new base would do the trick for you I think.<br>You would just do $c-&gt;req-&gt;base(&#39;<a href="http://www.mysite.tld:443&#39;">http://www.mysite.tld:443&#39;</a>)<br><br>I&#39;m sure they&#39;re are other ways to do this too.<br>
<br><br><div class="gmail_quote">On Wed, Mar 26, 2008 at 4:31 PM, Dustin Suchter &lt;<a href="mailto:dsuchter@ucla.edu" target="_blank">dsuchter@ucla.edu</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Can you directly control the port you redirect to? Part of my<br>
problem is having consistency between the production and test<br>
environments, which operate on 80/443 and 3000/3000 respectively.<br>
<font color="#888888"><br>
-d<br>
</font><div><div></div><div><br>
Ashley wrote:<br>
&gt; There are two approaches which have helped me. Remember the URI object<br>
&gt; underneath can be your friend.<br>
&gt;<br>
&gt; 1) Keep things relative.<br>
&gt; &nbsp; &nbsp;$c-&gt;uri_for(&quot;/blah&quot;)-&gt;path<br>
&gt; &nbsp; &nbsp;$c-&gt;uri_for(&quot;/blah&quot;)-&gt;path_query<br>
&gt;<br>
&gt; 2) Change the scheme yourself.<br>
&gt; &nbsp; &nbsp;my $uri = $c-&gt;uri_for(&quot;/blah&quot;);<br>
&gt; &nbsp; &nbsp;$uri-&gt;scheme( $my_test ? &quot;http&quot; : &quot;https&quot; );<br>
&gt;<br>
&gt; -Ashley<br>
&gt;<br>
&gt; On Mar 26, 2008, at 1:13 PM, Dustin Suchter wrote:<br>
&gt;<br>
&gt;&gt; Let&#39;s say I want to send people back and forth between an HTTP<br>
&gt;&gt; connection and an HTTPS connection on a server based on some action.<br>
&gt;&gt; For example, clicking on a &quot;logout&quot; button from within my application<br>
&gt;&gt; while connected via HTTPS does something like:<br>
&gt;&gt;<br>
&gt;&gt; $c-&gt;res-&gt;redirect(&quot;<a href="http://foo.com/" target="_blank">http://foo.com/</a>&quot;);<br>
&gt;&gt;<br>
&gt;&gt; The above seems like a fine solution except it totally disregards the<br>
&gt;&gt; beauty of uri_for, which I would love to be using for stuff like this.<br>
&gt;&gt; Without uri_for, problems arise when you do things like test via the<br>
&gt;&gt; built in Perl webserver (the one running on port 3000 by default)<br>
&gt;&gt; while on the same webserver as my &quot;production&quot; application.<br>
&gt;&gt;<br>
&gt;&gt; So the real question is, how do I properly refer to my webserver<br>
&gt;&gt; and/or application root and include port or SSL flags? I guess I&#39;m<br>
&gt;&gt; looking for something like $0 within uri_for.<br>
&gt;&gt;<br>
&gt;&gt; -d<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; List: <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a><br>
&gt;&gt; Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
&gt;&gt; Searchable archive:<br>
&gt;&gt; <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
&gt;&gt; Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; List: <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a><br>
&gt; Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
&gt; Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
&gt; Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
&gt;<br>
<br>
_______________________________________________<br>
List: <a href="mailto:Catalyst@lists.scsys.co.uk" target="_blank">Catalyst@lists.scsys.co.uk</a><br>
Listinfo: <a href="http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst" target="_blank">http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst</a><br>
Searchable archive: <a href="http://www.mail-archive.com/catalyst@lists.scsys.co.uk/" target="_blank">http://www.mail-archive.com/catalyst@lists.scsys.co.uk/</a><br>
Dev site: <a href="http://dev.catalyst.perl.org/" target="_blank">http://dev.catalyst.perl.org/</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>do() || do_not(); // try()<br>--------------------------------<br>Catapultam habeo. Nisi pecuniam omnem mihi dabis, ad caput tuum saxum immane mittam<br>--------------------------------<br>

<a href="http://www.kylehultman.com" target="_blank">http://www.kylehultman.com</a>