2015-10-16 111 views
0

所以我需要有這樣的:如何用htaccess刪除一部分URL?

http://example.com/panel/index.php?_url=/foo/bar/

,我需要做的htaccess力作爲

http://example.com/panel/foo/bar/使用htaccess顯示。

我該如何去做這件事?

回答

0

你可以試試這個:

RewriteCond %{QUERY_STRING} ^_url=(.*)$ 
RewriteRule ^panel/index.php panel%1? [R=301,L] 

「?」在RewriteRule的最後需要從結果字符串中刪除GET參數。