Laravel5 is configured with a ROUTE entry "/". Why cannot URL: ROUTE ('xxx') generate this underline?

Source: Internet
Author: User
I configured the route in this way, but on the page I wanted the link form to be m. xxx. comgushi followed by "". Do you have any problems with the configuration?

In this way

But on the page

The link I want is in the form of http://m.xxx.com/gushi/houyi uploads/downloads. Please ask each other about the configuration?

Reply content:

In this way

But on the page

The link I want is in the form of http://m.xxx.com/gushi/houyi uploads/downloads. Please ask each other about the configuration?

This is not simply a framework or routing configuration problem. In the url,/is specific, so you cannot define it as a separator.
In fact, for the web server,/category/AND/category are the same address. You can draw a picture.
In addition, the first thing in route resolution is to separate the request url according to '/'. Therefore, adding/to the url manually does not get the expected result. It is like the file name is not allowed to use/, because the system will not be able to figure out the path.

If you really want to implement the forward slash next to it, in apache. htaccess

#RewriteCond %{REQUEST_FILENAME} !-d#RewriteRule ^(.*)/$ /$1 [L,R=301]

Comment out, and then write the route in this way

Route::get('/hero/',['uses'=>'Mobile\HerosController@category','as'=>'m_heroCategory']);

You can see the example http://www.test.com/hero.

Reference http://stackoverflow.com/questions/22063520/laravel-slash-after-url-redirects-to-root-folder

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.