1
我切換了一個Shop-CMS並將大量舊URL放入.htaccess中以將舊產品重定向到其新位置。RedirectMatch:重定向到錯誤的URL
但一些重定向是錯誤的:
RedirectMatch 301 ^/products/catxy/313? https://www.example.com/products/catxy/product-1/
RedirectMatch 301 ^/products/catxy/314? https://www.example.com/products/catxy/product-2/
RedirectMatch 301 ^/products/catxy/319? https://www.example.com/products/catxy/product-3/
當我去example.com/products/catxy/319我重定向到產品-1,而不是產品3
據我瞭解上面的正則表達式意味着以/ products/catxy/319開頭[MAYBEMORE] - >重定向到產品-3
我不能寫^/products/catxy/319 $,因爲319有很多不同的結尾(該產品ID的所有變體)。
我不知道如果在我的情況下使用mod_rewrite會更好。
沒有,沒有工作......但與你回答我改變它^^products/catxy/319(。*)$這是在我的情況下工作 – suntrop
現在檢查它應該工作。 '313'後你的網址可能有更多的文字 – anubhava