0

I have an application using the A2 host provider, and inside the public directory its my laravel folder (www.website.com/app)

And in my server preferences I am redirecting the root "/" to "/app"

The app was OK, but today started to redirect a Route in specific..

  Route::get('/postagens/{Alias}/{dataInicio?}', array(
        'as' => 'artista.get.posts.all',
        'uses' => 'ArtistaController@getPostsMainFeed'
    )
);

Inside the generated HTML, it makes: http://www.website.com/app/artista/posts/twitter/ but when I access this address or send request via jquery, it redirects me to http://www.website.com/artista/posts/twitter, and that gives me a 404 (because There's no laravel app inside root...)

All the other Routes still working...

Any Idea?

Thanks

Editing

I inserted the wrong Route here, but BTW, I "solved" this by making the route without the second parameter, and adding it on the javascript instead using laravel URL::route.

VHeid
  • 1
  • 2
  • did you try to remove the first slash on the get? `Route::get('artista/posts/twitter/` – Fadey Mar 16 '15 at 17:43
  • @Fadey Yes! And I tried "debugging" with javascript, it's generating the correct URL, but when I try to access it, it just removes the "/app"(that is the laravel application folder) from the URL and redirects. – VHeid Mar 16 '15 at 18:31
  • It should, Laravel doesnt use the app in the route. the point of entry is the public folder – Fadey Mar 17 '15 at 16:09

1 Answers1

0

I was having the same problem trying to reach a route on the provided AuthController. It turned out to be middleware set in the constructor that I didn't see.

$this->middleware('guest', ['except' => 'logout']);

Which was 302-ing non-guests to the root page, even for the logout route despite being an exception.

shane
  • 109
  • 2
  • 7