<% strUrl = "https://www.mydomain.com/mypage.htm" strUrl = Replace(strUrl, "https://", "") strUrl = Replace(strUrl, ".htm","") strUrl = Replace(strUrl, ".html","") Response.Write strUrl %> Output: www.mydomain.com/mypage What you want is that?