asp.net URL URLs are rewritten as. html format, RSS, OPML Knowledge Summary _ Practical skills

Source: Internet
Author: User
First, URL web site rewrite
1, in the MSDNDownloadA file that will ActionlessForm.dllAnd URLRewriter.dllPut it in the bin directory. This is the address in an article in MSDN about URL rewriting.to perform a URL rewrite in asp.net

2, add the following code to the Web.config file

<!--custom configuration section-->
<configSections>
<section name= "Rewriterconfig" type= "URLRewriter.Config.RewriterConfigSerializerSectionHandler, Urlrewriter"/ >
</configSections>

<!--Rul rewrite rules-->
<RewriterConfig>
<Rules>
<!--XXX1 module rewrite rules-->
<RewriterRule>
<lookfor>~/(\d{4})/(\d{2})/(\d{2}) \.html</lookfor>
<sendto><! [cdata[~/mypage.aspx?param1=$1&param2=$2&param3=$3]]></sendto>
</RewriterRule>
<!--XXX2 module rewrite rules-->
<RewriterRule>
<lookfor>~/aaa/bbb/mypage/([\w]+) \.html</lookfor>
<sendto><! [cdata[~/aaa/bbb/mypage.aspx?param1=$1]]></sendto>
</RewriterRule>
</Rules>
</RewriterConfig>

<!--Register HTTP module-->
<add type= "Urlrewriter.modulerewriter, Urlrewriter" name= "Modulerewriter"/>
<!--<add verb= "*" path= "*.aspx" type= "Urlrewriter.rewriterfactoryhandler, Urlrewriter"/>

3, in IIS will . htmlFile mapping to X:\WINNT\Microsoft.NET\Framework\v1.1.4322\ Aspnet_isapi.dll

4, the use of methods:
Just change the rewrite rules in the web.config.
Note that: LookFor inside a pair () corresponding to the sendto inside a $[1, 2, 3...N]

Second, about RSS
RSS is a file format for RSS readers, it can also be called news seeds, RSS feeds, and so on. RSS is an XML file, and the suffix name can be. aspx, but the content must be XML. His grammar is as follows:
-------------------an RSS seed. Xml--------------------------------
<?xml version= "1.0" encoding= "gb2312"?>
<rss version= "2.0" >
<channel>
<title> name of this RSS feed (channel), title </title>
<link> The connection address for this RSS seed (channel). XML </link>
<description> A brief description of this RSS feed (channel), as you can write ...</description>

<item>
<title> specific reference headings, such as the title of a news </title>
<link>http://www. The connection address of the news. com/true HTML or ASPX address .aspx?aaa=1&bbb=2</link>
<description> the introduction of the news, is generally displayed part of the news content ...</description>
<pubDate> this goes without saying, release date </pubDate>
</item>
</channel>
</rss>
---------------------------------------------
In order for the search engine spider to know where this seed is, you can add a <link> to the ...... ......
<link rel= "Alternate" type= "Application/rss+xml" title= "my RSS title" href= "Http://www.myweb.com/rss/myrss.xml"/>
...... ......

-----------------------------------------------
In order for those who use RSS feeds to subscribe to the seed, you need to connect the file to the [RSS] picture or an (RSS) connection

Iii. about OPML
OPML file is actually a collection of RSS files, above is an RSS file, and OPML is a lot of RSS files directory.
The OPML file is also in XML format, and his syntax is as follows:
--------------MYOPML.OPML---------------------
<?xml version= "1.0" encoding= "gb2312"?>
&LT;OPML version= "1.0" >
<title> title of this OPML directory file </title>
<link> The connection address for this OPML directory file .opml</link>
<description> A brief description of this OPML directory file, as you can write ...</description>

<body>
<!--a outline record an RSS seed address-->
<outline type= "RSS"
title= "RSS seed title"
text= "RSS seed text, similar to title"
description= "brief description of RSS feeds"
Xmlurl= "The connection address of the RSS seed. xml"
Htmlurl= "RSS seed HTML connection address. xml"
/>
...... ......
</body>
</opml>
------------------------------------------------------
In order to let the search spider know OPML file is there, you can write a sentence in ... ...
<link rel= "Outline" type= "Application/xml" title= this OPML file's title "href=" The address of this OPML file. opml "/>
... ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.