2013-06-19 30 views
0

我有以下網址:部分與的.htaccess

http://example.com/directory/[email protected]&link=http://example.org

在「鏈接」變量的值總是會有http://或https://開頭,我會喜歡從URL中刪除它。

所以我最終會:

http://example.com/directory/[email protected]&link=example.org

+0

沒有下面的代碼回答你的問題? –

回答

1
RewriteEngine on 
RewriteCond %{QUERY_STRING} ^((.+&)?link=)(https?://)(.+)$ 
RewriteRule (.*) /$1?%1%4 [NC,L,R]