Support the ongoing development of Laravel.io →
Configuration Blade Validation
Last updated 2 years ago.
0

Hi Lynrch,

Maybe this way will work.

Routing sub domain docs: https://laravel.com/docs/5.2/routing#route-group-sub-domain-routing

Steps:

  1. Create new 404 page for sub-domain
views\errors\
|--404.blade.php                    (default 404 page for example.com)
|--404_subdomain.blade.php   (404 page for sub.example.com)
  1. In \app\Http\routes.php, try as follow
// 404 route for example.com
Route::get('/something', function () {  App::abort(404); });

// 404 route for sub.example.com
Route::group(['domain' => '{sub}.example.com'], function()
{
    Route::get('/something-sub-domain', function() { return view('errors/404_subdomain'); } );
});

Hope this helps. :)

Last updated 8 years ago.
0

Hi Khoa, thank for your answer, but need more,something like when any error NotFoundHttpException in example.com response 404.blade and any error NotFoundHttpExceptio in sub.example.com response 404_subdomain.blade. And more for 403 500 .... :(

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Lynrch lynrch Joined 25 Jul 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.