2011-05-16 66 views
0

嘿,我想從一個友好的URL即刪除查詢字符串我有ASP.NET從友好的URL刪除查詢字符串

/who-we-are/our-people.html?linkidentifier=id&itemid=42

而且我想上面的改變,以

/who-we-are/our-people.html

如何在刪除任何東西后執行.html

回答

2

最快的方法是使用System.Uri等級:

string pathOnly = new Uri("http://whatever.com/who-we-are/our-people.html?linkidentifier=id&itemid=42").AbsolutePath; 
+0

我怎樣才能用'pathOnly'替換地址欄中的網址? – Nezam 2013-11-25 02:58:27

0

您需要進行URL重寫。

在這裏你可以找到更多關於這個click here

相關問題