使用laravel在活動服務器(不是本地),我想告訴我的Laravel應用,像這樣:在domain.com/app文件夾
www.domain.com/app
,然後它會顯示該網站。
我該怎麼做? .htaccess可以做到這一點嗎?
我的.htaccess如下:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /dev
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
也有我的路線爲:
Route::group(array('domain' => 'domain.com/dev/'), function() {
Route::get('admin', '[email protected]');
Route::post('admin/postlogin', array('as' => 'admin.postlogin', 'uses' => '[email protected]'));
Route::get('admin/dashboard', array('as' => 'admin.dashboard', 'uses' => '[email protected]'));
Route::get('admin/dashboard', '[email protected]')->before('auth');
Route::get('admin/logout', '[email protected]');
Route::get('admin/pages','[email protected]')->before('auth');
Route::get('admin/pages/create','[email protected]')->before('auth');
lots more routes but wont post them all.
main one
/*
* Frontend
*/
Route::get('/{slug}', '[email protected]');
Route::get('/', function(){
return Redirect::to('/home');
});