Asp.net URL rewriting
This article is just an idea about URL rewriting. The MS component "urlrewriter" and the "application_beginrequest ()" encoding method in global. asax are successively available, as well as ISAPI settings in IIS.
The
In order to work with Seo, you need to rewrite the website URL. Seo is a systematic project. Doing well on various indicators will bring better results, there are only two ways to make websites friendly to search engines: static websites, fake URLs,
Url rewriting is the process of intercepting incoming web requests and automatically redirecting requests to other URLs.For example, if the browser sends a request for hostname/101. asp tutorial x, the server automatically directs the request to
When Nginx is a reverse proxy, it can cache the response from upstream to local and construct the response message directly from the local client when the same content is requested by subsequent clients.Nginx Cache Data Structure:Shared memory :
1.IIS7 Configure URL rewriting to be aware that the system is 32-bit or 64-bitIn the IIS7 configuration URL rewrite, you need to add "script mapping", if it is a 64-bit system, there will be two places to store the. NET Framework is a different
Detailed description and download DLL source path:Http://msdn.microsoft.com/zh-cn/library/ms972974.aspxIncidentally, I wrote a small example: Http://files.cnblogs.com/xuxu-dragon/Url%E9%87%8D%E5%86%99UrlRewrite.rarOneReferences ActionlessForm.dll
Download URL Rewrite component http://www.microsoft.com/zh-cn/download/details.aspx?id=7435
Import the officially supplied. htaccess file
Options +followsymlinks indexignore */* rewriteengine on # If a directory or a file
In the asp.net2.0 of urlmappings is very useful, but temporarily does not support regular expression, but, fortunately, if the ihttpmodule words
No matter what kind of request goes through IHttpModule First, this provides a good opportunity for URL
Chinese has been not very good, how do I explain this pathinfo mode is really don't know how to say, then first a piece of code said pathinfo mode bar 1 http://serverName/appName/module/action/id/1/ This is the PathInfo mode, without considering
To rewrite, first intercept the URL request, then analyze the URL at that time, and finally jump to the appropriate page. So our first step is to intercept the URL request.
Recently, a friend of mine is going to do the URL rewrite thing, I helped
Copy Code code as follows:
http://serverName/appName/module/action/id/1/
This is PathInfo mode.
Without considering routing, the first parameter is resolved to the module name (if grouping is enabled, then recursion backwards),
The. htaccess file URL overrides when the previous rule matches and transitions to the next rule that matches the next match conversionRewriterule ^shangpin-([0-9a-za-z]+)/category-([0-9]+)-([0-9]+)-(. +) \.html$ At the time of the URL shangpin-cat1
. Net implements URL rewriting and pseudo-static
1. Obtain Mircosoft URLRewriter. dll:
Get Mircosoft URLRewriter. dll available to http://www.microsoft.com/china/msdn/library/webservices/asp.net/URLRewriting.mspx? Mfr = true
After the download is
The following is an example:Copy codeThe Code is as follows:/** Convert the pseudo address to the original address (url_alter)*/Function example_url_inbound_alter (& $ path, $ original_path, $ path_language){If (preg_match ('| ^ article (/. *) |', $
Simply put, you need to install Microsoft's own URL rewrite plug-in, you can use the IIS own Web installation platform to find the installation. If this platform is not installed, please Baidu search by yourself.After the installation is complete,
What is the use of urlrewrite?1. Meet Search Engine RequirementsSome search engines cannot capture dynamic pages, and a large amount of information cannot be searched by potential users. With urlrewrite technology, you canHttp: // server/news. asp?
URL rewriting rules. This is mainly used for pseudo-static. Rewrite Rules are placed in. in the htaccess file or Apache configuration file (httpd. conf or some specific website configuration files in the sites_conf directory). This article mainly
The so-called pseudo-static page refers to URL rewriting, in ASP. net implementation is very simple first you need to reference two dll: actionlessform. DLL, urlrewriter. DLL, which is actually rewritten by urlrewriter. DLL, but if you want to
Recently, I had a friend who wanted to rewrite the URL. I helped him with this. I looked back at the article I wrote and thought it was easy to understand. but now I think it is not easy to write. today, Baidu's urlrewriter found that my article was
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.