0

I'm trying to set up a Laravel 4 environment, but when I'm linking to a sub-page it redirects immidiately to domain.com/route_name.

For instance on the page http://domain.com/public/ I have a link to a sub page called profile:

{{ HTML::linkRoute('profile', 'Profile') }}

In my routes.php it would look like this:

Route::get('profile',
  array(
    'as' => 'profile',
    'uses' => 'ProfileController@getIndex'
    )
  );

But instead it redirects all requests to http://domain.com/public/profile to http://domain.com/profile. Why so? I haven't been able to find a setting for it yet.

Edit Realised if I make a prefix (just anything), it will work, however it will load the URL http://domain.com/public/prefix/profile. So not a permanent solution.

Emil Moe
  • 389
  • 5
  • 18
  • why dont you have your webroot pointing to the public folder ? – lagbox May 26 '14 at 16:18
  • Unfortunately my current host don't support it at the moment, so my dev server is setup like this. It's not optimal, but I'm waiting till I find an other host. But it works on another project I'm on, so I'm sure it's just a matter for some setting :-) – Emil Moe May 26 '14 at 16:32
  • http://stackoverflow.com/questions/15586397/laravel-4-removing-public-from-url – The Alpha May 26 '14 at 18:10
  • Nope that's not it. I'm forced to have a prefix, I'm not talking about public I'm talking about **prefix**. I can't get rid of /prefix/, well I can, but then nothing works. – Emil Moe May 26 '14 at 21:44

1 Answers1

1

It is definitely not optimal, but you can probably modify the base URL in you app/config/app.php file to http://domain.com/public.

Valentin
  • 503
  • 1
  • 3
  • 15