<rewrite>
<rules>
<rule name="列表页静态" enabled="true">
<match url="^([^.]+)/list_([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="{R:1}/index.aspx?page={R:2}" appendQueryString="false" />
</rule>
<rule name="www伪静态" enabled="true">
<match url="([A-Za-z\d_]+)/detail_([0-9]+).html$" ignoreCase="true" />
<action type="Rewrite" url="/e/aspx/detail.aspx?table={R:1}&id={R:2}" appendQueryString="false" />
<conditions>
<add input="{HTTP_HOST}" pattern="^[url]www.xxxx.com[/url]" />
</conditions>
</rule>
<rule name="m伪静态" enabled="true">
<match url="([A-Za-z\d_]+)/detail_([0-9]+).html$" ignoreCase="true" />
<action type="Rewrite" url="/e/aspx/detail.aspx?table={R:1}&id={R:2}&site=7" appendQueryString="false" /> ///手机站伪静态 url重写时传了一个参数过去。 site=7
<conditions>
<add input="{HTTP_HOST}" pattern="^m.xxxx.com" />
</conditions>
</rule>
<rule name="手机站M" stopProcessing="false">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern="^m.xxxx.com$" />
<add input="{REQUEST_URI}" pattern="(mobile|e)/" negate="true" />
</conditions>
<action type="Rewrite" url="/mobile/{R:1}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
override protected void OnInit(EventArgs e)
{
string Table=Request.QueryString["table"];
string Id=Request.QueryString["id"];
string site=Request.QueryString["site"];
if(IsStr(Table) && IsNum(Id))
{
Conn Myconn=new Conn();
OleDbConnection conn=Myconn.OleDbConn();//获取OleDbConnection
conn.Open();
string sql="select id from pa_table where thetable='"+Table+"'";
OleDbCommand comm=new OleDbCommand(sql,conn);
OleDbDataReader dr=comm.ExecuteReader();
if(!dr.Read())
{
dr.Close();
conn.Close();
Response.Write("此信息未被调用!");
}
dr.Close();
sql="select site_id,lanmu_id,sublanmu_id , sort_id from "+Table+" where id="+Id;
comm=new OleDbCommand(sql,conn);
dr=comm.ExecuteReader();
if(dr.Read())
{
string sort_id=dr["sort_id"].ToString();
if(site == null){
Load_PageAdmin(int.Parse(dr["site_id"].ToString()),int.Parse(dr["lanmu_id"].ToString()),int.Parse(dr["sublanmu_id"].ToString()));
}
else
{
dr.Close();
sql="select id,lanmu_id from pa_sublanmu where sort_id= "+sort_id+" and site_id = "+site; //判断是手机站的url 查询手机站的栏目id
comm=new OleDbCommand(sql,conn);
dr=comm.ExecuteReader();
dr.Read();
Load_PageAdmin(int.Parse(site.ToString()),int.Parse(dr["lanmu_id"].ToString()),int.Parse(dr["id"].ToString()));
}
}
else
{
dr.Close();
conn.Close();
Response.Redirect("/");
}
conn.Close();
}
else
{
Response.Redirect("/");
}
}