I have uploaded my laravel 4.2 application to a /subfolder
of a shared hosting like www.example.com/bangla by following this answer.
Structure of my application is
example.com/ (the root of your web hosting)
|-- laravel4_base/ (Here goes all contents except public folder)
|-- [some other folders...]
|-- public_html/
| |-- [some other folders...]
| |-- bangla/ (Here goes contents of public folder)
Now i have these menu link in my view
<li><a href="/">Home</a></li>
<li><a href="/rj">Rj</a></li>
My problem is whenever i click them should route me to
www.example.com/bangla
www.example.com/bangla/rj
But it takes to
www.example.com
www.example.com/rj
My route.php looks like
Route::get('/','HomeController@index');
Route::get('rj','HomeController@rj');
HomeController.php looks like
public function index()
{
return View::make('home');
}
public function rj()
{
return View::make('rj');
}
So basically the base path is not being changed to subfolder www.example.com/bangla
I did a lot of searching in stackoverflow. Some are
laravel 4 setting base url to /subfolder
How to set sub-directory for base URL of laravel?
Also in laracast. But all are either unanswered or they do not have any answer that resolves the problem.
So, in simple words the question is how to change base url from www.example.com to www.example.com/bangla