Php Laravel 5.5路由和子域路由
我对拉雷维尔很陌生。我目前在Laravel 5.5上创建了我的个人网站,并上传到GoDaddy服务器:。现在,当我在导航中单击“Blog”时,我想将其重定向到“bhattraideb.com/public/Blog” 再次从同一链接“bhattraideb.com/public/blog”中,当我单击“恢复”时,我会在“bhattraideb.com/”上重定向 这是我的路线代码 //**恢复航线Php Laravel 5.5路由和子域路由,php,laravel-5,Php,Laravel 5,我对拉雷维尔很陌生。我目前在Laravel 5.5上创建了我的个人网站,并上传到GoDaddy服务器:。现在,当我在导航中单击“Blog”时,我想将其重定向到“bhattraideb.com/public/Blog” 再次从同一链接“bhattraideb.com/public/blog”中,当我单击“恢复”时,我会在“bhattraideb.com/”上重定向 这是我的路线代码 //**恢复航线 Route::prefix('/')->group(function() { Rou
Route::prefix('/')->group(function() {
Route::get('/', 'Frontend\ResumeController@index')->name('resume.index');
Route::resource('resume', 'Frontend\ResumeController');
});
//**博客路线
Route::get('show/{id}', 'Frontend\PostController@show')->name('post.show');
Route::get('blog/{slug}', ['as' => 'post.single', 'uses' => 'Frontend\PostController@getSingle'])->where('slug', '[\w\d-\_]+');
Route::resource('blog', 'Frontend\PostController');
谁能给我指点一下吗
提前感谢。您可以阅读更多详细信息,但以下简单示例应该可以:
web.php
Route::group(["domain" => "blog.bhattraideb.com" ], function () {
Route::get("/", "Frontend\PostController")->name("blog.index");
//All blog routes should be defined in here
});
然后,在生成指向博客的链接时,您可以使用helper路由(“blog.index”)
获取URL以及子域
请注意,您需要将Web服务器设置为接受blog.bhattraideb.com
作为bhattraideb.com
的别名。然后拉威尔会把剩下的整理好