我的网站运行一个名为 - > WSS壁纸脚本的脚本
我的问题 - >我一直在尝试强制删除或在我的URL末尾添加尾部斜杠以防止重复内容并清理我的URL.
我已经尝试了各种各样的尝试,并尝试了我能想到的一切,并从互联网上加载,但没有这样的运气!这可能是一个快速修复,但我已经看了很多,我可能对死明显的东西视而不见.
所以我告诉你我所有的.htaccess代码:
DirectoryIndex index.php
RewriteEngine on
RewriteRule ^download/([0-9]+)?/([0-9]+)x([0-9]+)/([^/\.]+) image.php?id=$1&width=$2&height=$3&cropratio=$4&download=1 [L]
RewriteRule ^file/([0-9]+)?/([0-9]+)x([0-9]+)/([^/\.]+) image.php?id=$1&width=$2&height=$3&cropratio=$4 [L]
RewriteRule ^preview/([0-9]+)?/([0-9]+)x([0-9]+)/([^/\.]+) wallpaper_preview.php?id=$1&width=$2&height=$3&name=$4 [L]
RewriteRule ^thumbnail/([0-9]+)?/([0-9]+)x([0-9]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/]+) image.php?wallpaper_id=$1&width=$2&height=$3&cropratio=$4&align=$5&valign=$6&file=$7 [L]
RewriteRule ^cat/([0-9]+)?/([^/\.]+)/p([0-9]+) index.php?task=category&id=$1&name=$2&page=$3 [L]
RewriteRule ^cat/([0-9]+)?/([^/\.]+)/([0-9a-zA-Z?-]+)/p([0-9]+) index.php?task=category&id=$1&name=$2&sortby=$3&page=$4 [L]
RewriteRule ^cat/([0-9]+)?/([^/\.]+)/([0-9a-zA-Z?-]+)-([0-9]+) index.php?task=category&id=$1&sortby=$3&page=$4 [L]
RewriteRule ^cat/([0-9]+)?/([^/\.]+) index.php?task=category&id=$1&name=$2 [L]
RewriteRule ^tag/([^/\.]+)/([0-9a-zA-Z?-]+)/([0-9]+) index.php?task=tag&t=$1&sortby=$2&page=$3 [L]
RewriteRule ^tag/([^/\.]+) index.php?task=tag&t=$1 [L]
RewriteRule ^profile/([0-9]+)?/([^/\.]+) index.php?task=profile&id=$1&name=$2 [L]
RewriteRule ^profile/comments/([0-9]+)?/([^/\.]+) index.php?task=users_comments&id=$1&name=$2 [L]
RewriteRule ^page/([0-9]+) index.php?task=view_page&id=$1 [L]
RewriteRule ^register index.php?task=register [L]
RewriteRule ^lost-password index.php?task=lost_pass [L]
RewriteRule ^links index.php?task=links [L]
RewriteRule …Run Code Online (Sandbox Code Playgroud) 如何使Laravel 5.3创建带有斜杠的路径URL?
该路线定义为
Route::get('/home/', ['as' => 'home', 'uses' => 'HomeController@index']);
Run Code Online (Sandbox Code Playgroud)
然后我在视图中使用路径助手函数创建url:
{{ route('home') }}
Run Code Online (Sandbox Code Playgroud)
这创造了http://localhost:8000/home而不是http://localhost:8000/home/.
这个问题与Laravel非常相似- 在路线中附加一个尾随斜线,但这个问题也没有答案,在我看来,我的描述更短.
编辑:文档中的两种可能的命名方法没有区别:
Route::get('/home/', ['as' => 'home', 'uses' => 'HomeController@index']);
Route::get('/home/', 'HomeController@index')->name('home');
Run Code Online (Sandbox Code Playgroud)