Support the ongoing development of Laravel.io →
Authentication Security
Last updated 2 years ago.
0

It depends, if htaccess or some server rewrite is forcing https then the software layer won't be able to stop it and you would have to change it where ever that rewrite is happening.... however if it is just that all inbound links have https then I would create a method that tests for a secdure request (https) and redirects back non secure url (http)


Route::group(array('before' => 'auth|nohttps'), function()
{
    Route::get('something', 'SomeController@data');
});

Then your filter looks like this

Route::filter('nohttps', function() {
  if Request::secure() {return Redirect::to('http://' . Request::url());}
}
Last updated 2 years ago.
0

After I applied that filter it's giving me error

syntax error, unexpected 'Request' (T_STRING), expecting '('

And i even tried to form that to this

Route::filter('nohttps', function() {
  if Request::secure() {return Redirect::to('http://' . Request::url());}
});

But the error is still same

Last updated 2 years ago.
0

Whoops sorry... missing brackets around if statement

Route::filter('nohttps', function() {
  if (Request::secure()) {return Redirect::to('http://' . Request::url());}
}
Last updated 2 years ago.
0

Thank you, but it didn't work. The problem was in link in view.

{{ HTML::link('something', 'Some Link', null, ['class' => 'btn btn-lg btn-primary']) }}

I forgot there that "null, ['class' => 'btn btn-lg btn-primary']", because I have there lot of links "{{ link_to_route(" with css button style from bootstrap, and only this one I remaked to that HTML::link. So after I deleted that forgotten things, it works. But I think it's pretty weird, that only this forgotten class make all that problem with https.

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.