0
所以我有一種奇怪的麻煩。我從在htaccess中重寫問題
mysite.com/brand.php?brand=example&ref=ex1
到
mysite.com/brand/example/ex1
重寫規則,我設法做到這一點,但也有另外一個問題:當你輸入:
mysite.com/brand/example/ex1.html
或
mysite.com/brand/example/ex1.php
我得到這個:
mysite.com/brand/example/ex1?ref=ex1.php&brand=example
任何人都可以告訴我爲什麼我得到這個重定向以及如何擺脫它?
我嘗試這樣做:
RedirectMatch ^brand/([A-Za-z0-9-\.\_]+)/([A-Za-z0-9-\.\_]+)php$ /brand/$1/$2
或本:
RedirectMatch ^brand/([A-Za-z0-9-\.\_]+)/([A-Za-z0-9-\.\_]+)\.php$ /brand/$1/$2
,但它根本不起作用。
請大家幫幫我!
請問你能說出這段代碼的作用嗎? –
@AlickDikan已更新答案... –