如何修复 Laravel 中的重复链接问题

时间:2021-02-14 12:48:03

标签: php laravel google-analytics

我的类别有一个 URL,如下所示:example.com/shop/category1

这是我的 web.php 中的代码:

Route::any('shop/{slug}', 'CategoryController@category')->name('category');

我还有很多其他的产品、文章等途径

但是当我分析我的网站时,我在所有这样的路线中都有这个商店

example.com/products/shop
example.com/articles/shop
example.com/shop/shop

其他路由正常,不知道是什么问题!

其他路线:

Route::any('products', 'ProductController@index')->name('products.index');
Route::get('products/{slug}', 'ProductController@detail')->name('products.detail');

Route::get('articles', 'ArticleController@index');
Route::get('articles/{slug}', 'ArticleController@detail')->name('articles.show');

更新

路线屏幕:

route-scrren-1

route-screen-2

route-screen-3

0 个答案:

没有答案