first of all, sorry if that question has been answered in another thread, but I spent quite some time researching it and nothing. I did find an old post without answers here (Url redirect append new url to the old url).
Here is my problem:
When redirecting in Laravel and only on my developement server, the new url gets appended to the old one.
So for example, let's say I am on adomain.com/login and the form action is set to URL::route('doLogin') <=> adomain.com/doLogin. When displaying the page, the form action is set to "adomain.com/login/http://adomain.com/doLogin"
What I don't understand is that the exact same code works on my production server, with the exact same settings.
Here is my setup:
I have two Laravel Forge provisioned servers on Digital Ocean(Ubuntu, NginX). I used the same configuration for both as one is my production server and the other one is my dev server/test server. I use BitBucket to commit my changes on branches (master for production and dev for development).
Can someone help me understand/fix this issue?
Thanks, Stef
**** Update
Thanks for your suggestions, I am not sure how I can add the http. I am using Laravel as follow:
View:
Form::open(array('url'=>URL::route('adminLogin'), 'class'=>'form-horizontal'))
Routes:
Route::get ('admin/login', array('as' => 'adminLogin', 'uses'=>'AdminAuthController@showLogin'));
Route::post('admin/login', 'AdminAuthController@postLogin');
Route::get ('admin/logout', 'AdminAuthController@getLogout');
And this is the html I get for the form on the page:
<form method="POST" action="http://adomain.com/http://adomain.com/admin/login" accept-charset="UTF-8" class="form-horizontal">
My local environement is LAMP: It works perfectly
My developement environment is Ubuntu 14.04 with NginX, MySql and PHP: It does not work
My production environement is Ubuntu 14.04 with NginX, MySql and PHP: It works perfectly
I am completely clueless.
this has happened to me alot and i found that the base url needs the http or https included. this also happens when you create a html link and write it like this:
href="adomain.com/login"
you have to write out the whole link including the http otherwise ull have the same issue as above.
href="http://adomain.com/login"