The problem of beginner Laravel

Source: Internet
Author: User
Because there are other items in the Web root directory, a Laravel folder is built in the root directory for test learning, and a welcome page is available to access http://localhost/laravel/public. Later want to remove public, refer to this site http://tutsnare.com/remove-public-from-url-laravel/the second method, direct access to Http://localhost/laravel can see the Welcome page. When learning to route, add a

Route::post('test', function(){    return 'test';});

Then access to Http://localhost/laravel/test has been 404, where is the problem?

Reply content:

Because there are other items in the Web root directory, a Laravel folder is built in the root directory for test learning, and a welcome page is available to access http://localhost/laravel/public. Later want to remove public, refer to this site http://tutsnare.com/remove-public-from-url-laravel/the second method, direct access to Http://localhost/laravel can see the Welcome page. When learning to route, add a

Route::post('test', function(){    return 'test';});

Then access to Http://localhost/laravel/test has been 404, where is the problem?

First, first this is a post route, if it is http://localhost/laravel/test access:

Route::get('test', function(){    return 'test';});

Second, please check if your server is heavy (Apache or Nginx) write rules conform to laravel rules

Third, why not just use PHP artisan serve?

IV: I recently online community, free video tutorial: https://laravist.com/have laravel related questions can come here to ask me, almost all day waiting. haha haha

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.