[Catalyst] uri_for adding :443 to URL when HTTPS=on

Charlie Garrison garrison at zeta.org.au
Tue Sep 4 14:24:43 GMT 2007

Good evening,

On 3/9/07 at 7:54 PM +0100, Matt S Trout 
<dbix-class at trout.me.uk> wrote:

>>  The above error makes sense in the context of 
>>frontend/backend  apache with rewrite rules.
>>       RewriteRule ^/login(.*)$     
>>http://%{HTTP_HOST}:8627/progs/login$1 [P]
>>      RewriteRule ^/progs/(.*)$    
>>http://%{HTTP_HOST}:8627/progs/$1 [P]
>That's kinda broken, it's relying on the request header which a browser
>could easily cock up.

Fair enough, although I've seen heaps of examples using 
%{HTTP_HOST} so I followed along.

>I suspect %{REMOTE_HOST} would be better (see the mod_rewrite docs for
>more info)

REMOTE_HOST seems to be the client host name, not the server. So 
I don't think that's the one you meant. Did you mean SERVER_NAME 
instead? Since SERVER_NAME seems to give the value I expect, 
I'll switch to using that. Still doesn't really solve the core 
issue though.

When I generate a URI string with $c->uri_for(...) and HTTPS=on, 
then I get :443 as part of the URI string. What can I do in my 
Catalyst config (or elsewhere) to prevent :443 being included in 
the URI string?


    Charlie Garrison  <garrison at zeta.org.au>
    PO Box 141, Windsor, NSW 2756, Australia

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

More information about the Catalyst mailing list