我需要一個簡單的正則表達式來匹配asp頁面並將它們重定向到另一個頁面。正則表達式htaccess
例如
/showdetails.asp?id=1334
到
/page-redirect.php?page=showdetails&id=1334
這是我迄今爲止這似乎並沒有工作
RedirectMatch 301 ^/(.*)\.asp?id=(.*)$ /page-redirect.php?page=$1&id=$2
其中作爲
RedirectMatch 301 ^/(.*)\.asp$ /page-redirect.php?page=$1
似乎工作。
沒關係解決它自己,以躲避需要的?
RedirectMatch 301 ^/(.*)\.asp\?id=(.*)$ /page-redirect.php?page=$1&id=$2