如何在网络上部署Laravel Project

问题描述 投票:2回答:1

我已经开发了一个网站,其网址为: http://localhost/abc/public/index.php/account/sign-in

我想将部署URL更改为http://localhost/xyz/public/index.php/account/sign-in

如何在laravel中更改基本URL?

我曾尝试在app文件夹中的app.php中更改URL,但对我没有用。 上传项目后,它显示Forbbiden 404错误。

我的路线

/**
 * Authenticated group
 */
Route::group(array('before' => 'auth'), function() {

    /**
     * Sign Out(get)
     */
    Route::get('/account/sign-out', array(
        'as' => 'account-sign-out',
        'uses' => 'AccountController@getSignOut'
    ));

    /**
     * Delivery Staff Details(GET)
     */
    Route::get('/add-delivery-staff-details', array(
        'as' => 'add-delivery-staff-details',
        'uses' => 'DeliveryStaffController@getDeliveryStaffDetails'
    ));

    /**
     * Delivery Staff Details(POST)
     */
    Route::post('/add-delivery-staff-details', array(
        'as' => 'add-delivery-staff-details-post',
        'uses' => 'DeliveryStaffController@postDeliveryStaffDetails'
    ));

    /**
     * Show Delivery Staff Details to Shop Manager(GET)
     */
    Route::get('/show-delivery-staff-details', array(
        'as' => 'show-delivery-staff-details',
        'uses' => 'DeliveryStaffController@showDeliveryStaffDetails'
    ));

    /**
     * Get Delivery Shaff Id To its Location(GET)
     */
    Route::get('/get-delivery-staff-id', array(
        'as' => 'get-delivery-staff-id',
        'uses' => 'TrackDeliveryStaffController@showGetDeliveryStaffId'
    ));

    /**
     * Get Delivery Shaff Id To its Location(POST)
     */
    Route::post('/get-delivery-staff-id', array(
        'as' => 'get-delivery-staff-id-post',
        'uses' => 'TrackDeliveryStaffController@postGetDeliveryStaffId'
    ));

    /**
     * Track Delivery Staff(GET)
     */
    Route::get('/track-delivery-staff', array(
        'as' => 'track-delivery-staff',
        'uses' => 'TrackDeliveryStaffController@trackDeliveryStaff'
    ));

    /**
     * 
     */
    Route::get('/assign-delivery-task', array(
        'as' => 'assign-delivery-task',
        'uses' => 'DeliveryStaffController@getAssignDeliveryTask'
    ));

    Route::post('/assign-delivery-task', array(
        'as' => 'assign-delivery-task-post',
        'uses' => 'DeliveryStaffController@postAssignDeliveryTask'
    ));



    /**
     * Accept latlong(GET)
     */
    Route::post('/lat-long', array(
        'as' => 'lat-long',
        'uses' => 'TrackDeliveryStaffController@acceptLatLong'
    ));

    /**
     * Accept latlong(POST)
     */
    Route::post('/lat-long-post', array(
        'as' => 'lat-long-post',
        'uses' => 'TrackDeliveryStaffController@postlatLong'
    ));



    /**
     * Show Delivery Staff on Map
     */
    Route::get('/orders', array(
        'as' => 'orders',
        'uses' => 'DeliveryStaffController@getOrders'
    ));

    /**
     * 
     */
    Route::post('/orders', array(
        'as' => 'orders-post',
        'uses' => 'DeliveryStaffController@postOrders'
    ));

    /**
     * Assign Staff From Different Shift to Current Shift(GET)
     */
    Route::get('add-staff-from-different-shift', array(
        'as' => 'add-staff-from-different-shift',
        'uses' => 'DeliveryStaffController@showaAddStaffFromDifferentShift'
    ));

    /**
     * Assign Staff From Different Shift to Current Shift(POST)
     */
    Route::post('add-staff-from-different-shift', array(
        'as' => 'add-staff-from-different-shift-post',
        'uses' => 'DeliveryStaffController@postAddStaffFromDifferentShift'
    ));

    /**
     * Remove Staff From Temp Shift(GET)
     */
    Route::get('remove-staff-from-temp-shift', array(
        'as' => 'remove-staff-from-temp-shift',
        'uses' => 'DeliveryStaffController@showRemoveStaffFromTempShift'
    ));

    /**
     * Remove Staff From Temp Shift(GET)(POST)
     */
    Route::post('remove-staff-from-temp-shift', array(
        'as' => 'remove-staff-from-temp-shift-post',
        'uses' => 'DeliveryStaffController@postRemoveStaffFromTempShift'
    ));

    Route::get('select-area', array(
        'as' => 'select-area',
        'uses' => 'DeliveryStaffController@showSelectArea'
    ));

    Route::post('select-shop', array(
        'as' => 'select-shop',
        'uses' => 'DeliveryStaffController@selectShops'
    ));
    /**
     * Assign pickup area and shop and delivery boy to orders
     */
    Route::get('assign-orders', array(
        'as' => 'assign-orders',
        'uses' => 'DeliveryStaffController@showAssignOrders'
    ));
    Route::get('email', array(
        'as' => 'email',
        'uses' => 'DeliveryStaffController@email'
    ));

//     Route::post('user_Profile/userInfo', 'DeliveryStaffController@selectShops');
});



/**
 * This is Home Controller
 */
Route::get('/', array('as' => 'home', 'uses' => 'HomeController@home'));

/**
 * This is blank Page
 */
Route::get('/blank', function() {
    return View::make('pages.blank');
});


/**
 * Unauthenticated group
 */
Route::group(array('before' => 'guest'), function() {


    /**
     * CSRF request
     */
    Route::group(array('before' => 'csrf'), function() {
        /**
         * Create Account (POST)
         */
        Route::post('/account/create', array(
            'as' => 'account-create',
            'uses' => 'AccountController@postCreate'
        ));
    });
    /**
     * Sign In Account (GET)
     */
    Route::get('/account/sign-in', array(
        'as' => 'account-sign-in',
        'uses' => 'AccountController@getSignIn'
    ));
    /**
     * Sign In Account (POST)
     */
    Route::post('/account/sign-in', array(
        'as' => 'account-sign-in-post',
        'uses' => 'AccountController@postSignIn'
    ));
    /**
     * Forgot Password (GET)
     */
    Route::get('/account/forgot-password', array(
        'as' => 'account-forgot-password',
        'uses' => 'AccountController@getForgotPassword'
    ));
    /**
     * Forgot Password (POST)
     */
    Route::post('/account/forgot-password', array(
        'as' => 'account-forgot-password-post',
        'uses' => 'AccountController@postForgotPassword'
    ));
    /**
     * Create Account (GET)
     */
    Route::get('/account/create', array(
        'as' => 'account-create',
        'uses' => 'AccountController@getCreate'
    ));
    /**
     * Reset Password (get)
     */
    Route::get('/account/reset-password/{code}', array(
        'as' => 'reset-password',
        'uses' => 'AccountController@getResetPassword'
    ));
    /**
     * Reset Password (POST)
     */
    Route::post('/account/reset-password', array(
        'as' => 'reset-password-post',
        'uses' => 'AccountController@postResetPassword'
    ));

    //Route::post('user_Profile/userInfo', 'DeliveryStaffController@selectShops');
    Route::get('/select-shop', array(
        'as' => 'select-shop',
        'uses' => 'DeliveryStaffController@selectShops'
    ));
    Route::post('/select-shop1', array(
        'as' => 'select-shop',
        'uses' => 'DeliveryStaffController@selectshopsaa'
    ));


});
php laravel-4
1个回答
0
投票

您可以尝试使用以下命令使您的应用仅监听localhost和项目名称,因此base_url将被视为http:// localhost / xyz /

php -S localhost -t public

这应该以基础URL监听您的项目名称。

© www.soinside.com 2019 - 2024. All rights reserved.