Hi, I got a solution, but I would like knows if it is a nice solution.
My code:
#region Custom Redirect
string strCustomPath;
string strCurrentPath = Request.Path.ToLower();
// Search the page to fire the rewriter
if (strCurrentPath.ToLower().IndexOf("rentals.rt") > -1)
{
string parametros = string.Empty;
// Search the parameters by querystring
if (URLRewriter.CurrentURL.IndexOf('?') > -1)
parametros = URLRewriter.CurrentURL.Substring(URLRewriter.CurrentURL.IndexOf('?'));
// new path
strCustomPath = string.Format("/rentals.aspx{0}", parametros);
// Rewrite the URL
Context.RewritePath(strCustomPath);
}
#endregion
The url will be www.mysite.com/country/state/rentals.rtl?a=1&b=2&c=3 but the page called is /rentals.aspx.