2

I have developed a website and its available on the URL: http://localhost/abc/public/index.php/account/sign-in

I want to change the deployment URL to http://localhost/xyz/public/index.php/account/sign-in

How to change the base URL in laravel?

I have tried changing URL in app.php in app folder but it didn't worked for me. After uploading project it is showing Forbbiden 404 error.

My Route

/**
 * 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'
    ));


});
Maxime Pacary
  • 22,336
  • 11
  • 85
  • 113
Parag Bhingre
  • 830
  • 2
  • 11
  • 20
  • your localhost url setup is not correct even your new one, normally it should be localhost/account/sign-in, you must have set it up wrongly some where in your route, can you post your route? – Maytham Fahmi Jul 27 '15 at 14:13
  • Does `http://localhost/xyz/public/account/sign-in` or `http://localhost/xyz/public/account/sign-in` work? Are you using apache? nginx? some other web server like IIS? check out http://laravel.com/docs/4.2#pretty-urls – Ben Claar Jul 27 '15 at 20:49
  • maytham i updated my question. now you can see my route – Parag Bhingre Jul 28 '15 at 10:47
  • sorry for late response, i do not know if you have further progress here, but your route looks ok, I would suspect the way you have setup your webserver I suggest you do virtual hosts, then you won't have problem moving online. Look at this guide line if you use xampp on your local environment http://stackoverflow.com/questions/27754367/how-to-setting-up-virtual-hosts-for-xampp-on-windows-full-guideline/27754990#27754990 to see how laravel is setup, if you do that you will have a correct path some thing like example `http://laravelproject1.localhost/account/sign-in` – Maytham Fahmi Aug 05 '15 at 23:24
  • Maybe you'll find your answer [here][1]. It's similar to your question. [1]: http://stackoverflow.com/questions/16683046/how-to-install-laravel-4-to-a-web-host-subfolder-without-publicly-exposing-app – Josip Ivic Sep 14 '15 at 09:31

1 Answers1

0

You may try below command to make your app listen to localhost and project name only, so the base_url will be treated as http://localhost/xyz/

php -S localhost -t public

this should listen to your project name as base url.