Advertisement
febripratama

subdomain routing

Aug 6th, 2015
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.47 KB | None | 0 0
  1. ----- route.php
  2.  
  3. Route::group(array('domain' => '{account}.domain.com'), function() {
  4.  
  5.     Route::get('/', function($account) {
  6.        
  7.         $user = Tbl_user::where('user_permalink',$account)->first();
  8.  
  9.         if (is_object($user)) {
  10.  
  11.             return View::make('subdomain.home');
  12.  
  13.         }
  14.  
  15.         return View::make('subdomain.notfound');
  16.     });
  17.  
  18. });
  19.  
  20. ---------DNS management
  21. *.domain.com type A pointing ke IP server
  22.  
  23. ---------vhost apache
  24. ServerAlias *.domain.com
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement