Why even bother to use Wordpress? Thats for people that don't know how to program xD
If it were me and I had to pull this off as you described I would install Wordpress in the public folder of laravel..... so /home/user/public/wp
/home/user/app
Then I would create the routes I want handled by Laravel.... Followed by a catch all that routes to WP
Route::get('/', array('as'=>'root', 'uses'=>'HomeController@showWelcome'));
Route::get('home', array('as'=>'home', 'uses'=>'HomeController@showWelcome'));
Route::get('login', array('as'=>'login', 'uses'=>'HomeController@showWelcome'));
//catch all and route to wordpress
Route::get('/{alias?}', function($alias) {
return Redirect::to('/wp/' . $alias);
});
It might need a little tweaking but as long as the wordpress files live in a folder inside Laravel's public folder then the URLs will route...... a more simple way would just have all wordpress links start with /wp/ then you don't even need the catch all it will auto route to the folder in public. But if you don't want people to have to do /wp/contact-us and you just want them to do /contact-us and hit wordpress then my example should work.
I am in this situation right now. Has this been resolved? Please share the solution. Thanks!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community