Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

scottycam's avatar

Redirect::route(...) adds :80 to URL causes error.

I am using cloud9 and laravel 4.2.

I have the basics of laravel going well. I have multiple routes and views set up all working great.

My issue is when I use something like ** return Redirect::route('homepage'); ** within a route itself, for my case a route that deletes a row from a table and returns to the homepage. the redirect works except it adds :80 to my URL (like so "username.c9.io:80/workspace/) and causes the following error.

Error code: ssl_error_rx_record_too_long

If I manually remove :80 from the URL the correct page loads.

So the redirect::route is redirecting to the correct URL with the addition of :80 which causes the problem.

I have tried using different redirect methods but seem to always add the :80 and I am unsure why.

0 likes
1 reply
rikh's avatar

Is this an https site? Is it behind a load balancer? Is the load balancer dealing with SSL and forwarding http requests on to your site? If so, you probably need to set some trusted proxies, so your site know it originated from an https request.

An excellent package for dealing with this out of the box is Chris Fidao's excellent Trusted Proxies https://github.com/fideloper/TrustedProxy

Please or to participate in this conversation.