2011-10-11 36 views
2

我有數百抓取錯誤來鏈接,如:

http://www.myfakebaseurl.com/education/imgcourse/Course.php?wikiinfa=1&page=5438

,我想重定向到:

http://www.myfakebaseurl.com/education/courses.html

RewriteRule ^education/imgcourse/Course.php?(.*)$ http://wwww.myfakebaseurl.com/education/courses.html [R=301,L] 

仍結果於:

http://www.myfakebaseurl.com/education/courses.html?wikiinfa=1&page=4973 

我如何擺脫所有$ _GET變量?

+0

可能重複(http://stackoverflow.com/questions/543228/remove-all-query-strings-from-requests-for-particular-page ) –

回答

1

除非給出QSA標誌,否則新給定的查詢字符串將替換舊的查詢字符串,因此只需提供一個空的查詢字符串即可。

RewriteRule ... http://example.com/foo.php? [L] 
的[刪除從特定頁面請求的所有查詢字符串]