Username as subdomain on laravel

后端 未结 4 1448
滥情空心
滥情空心 2021-01-30 07:47

I\'ve set up a wildcard subdomain *.domain.com & i\'m using the following .htaccess:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteCond %{HT         


        
4条回答
  •  一个人的身影
    2021-01-30 08:21

    Laravel 4 has this functionality out of the box:

    Route::group(array('domain' => '{account}.myapp.com'), function() {
    
        Route::get('user/{id}', function($account, $id) {
            // ...
        });
    
    });
    

    Source

提交回复
热议问题