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());}
}
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
Whoops sorry... missing brackets around if statement
Route::filter('nohttps', function() {
if (Request::secure()) {return Redirect::to('http://' . Request::url());}
}
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.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community