我有一个当前网站,所有网址都以.html结尾。
我创建了一个新网站,而且网址几乎相同,但没有.html。
我一直在尝试在我的.htaccess文件中找到的代码,而且大多数代码都会导致内部服务器错误。
DB::connection()->enableQueryLog();
DB::table('products')
->leftJoin('product_locations', 'products.id', '=', 'product_locations.productId')
->select(DB::raw('IF(product_locations.id is not null,concat(product_locations.id,"-","M"),concat(products.id,"-","N")) as id'), DB::raw('IF(product_locations.id is not null,1,0) as multilocation'), 'products.productName', 'products.productName as text', 'product_locations.productLocationName', 'product_locations.binLocationName', 'product_locations.unitCost', 'product_locations.amount')
->orderBy('products.productName')
->distinct()
->get();
dd(DB::getQueryLog())
我当前的htacces文件代码是:
http://example.com/page1.html to http://example.com/page1/
http://example.com/page1/page2.html to http://example.com/page1/page2/
答案 0 :(得分:0)