Salve a tutti, ho questo file global.asax
<%@ Application Language="C#" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Text.RegularExpressions" %>
<script runat="server">
void Application_BeginRequest(object sender, EventArgs e)
{
var regex = new Regex("^/dettaglio-offerta-last-minute-(.*)-(.*)-(.*)-(.*)", RegexOptions.IgnoreCase);
var match = regex.Match(Request.Url.AbsolutePath);
if (match.Success)
HttpContext.Current.RewritePath("/dettaglio-offerta-last-minute.asp?id=" + match.Groups[1].Value);
}
</script>
vorrei aggiungere un altra condizione di riscrittura url, ma non arrivo al dunque....
<script runat="server">
void Application_BeginRequest(object sender, EventArgs e)
{
var regex = new Regex("^/zona-offerte-(.*)", RegexOptions.IgnoreCase);
var match = regex.Match(Request.Url.AbsolutePath);
if (match.Success)
HttpContext.Current.RewritePath("/zonaofferte.asp?id=" + match.Groups[1].Value);
}
</script>
Gabriele