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