1. Add a slash at the end of the URLThis adds a rewrite rule to the virtual host:Rewrite ^ (. *[^/]) $ $1/permanent;For example:server {Listen 80;server_name bbs.ttlsa.com; Rewrite ^ (. *[^/]) $ $1/permanent;}2. Remove the slash at the end of the URLThis adds a rewrite rule to the virtual host:Rewrite ^/(. *)/$/$1 Permanent;For example:server {Listen 80;server_na
In previous articles, we have discussed several main aspects of URL Rewrite. In the last article of this series, we will discuss some details and features about different levels of URL Rewrite.
Theoretically, IIS-level URL Rewrite
In previous articles we have talked about several key aspects of URL rewrite. In the last article in this series, we'll discuss some of the details and characteristics of different levels of URL rewrite.
In theory, the IIS-level URL rew
No one may use the method in the previous article to perform URL Rewrite, because the component that provides URL Rewrite is already overwhelming.
The principle of the ASP. NET-level URL Rewrite component is very simple. In fact,
After the URL rewrite, the problem that is often encountered is that the postback destination address in the page is not the address that the client requested, but the address after the URL rewrite. For example, rewrite in one of the previous articles:
When the user requ
://www.jb51.net/home?id=5
For example, if you redirect a similar url/photo/123456 to/path/to/photo/12/1234/123456.png
Copy Code code as follows:
Rewrite "/photo/([0-9]{2}) ([0-9]{2}) ([0-9]{2})"/path/to/photo/$1/$1$2/$1$2$3.png;
Note: If there are curly braces "{" or "}" inside the regular expression, you should use double quotes or single quotes. Linux Learning, http://li
One of the easiest ways to implement URL rewriting (urlrewriter) in asp.net.
Reference (author Scott Mitchell translation: Janssen) of the masterpiece, although not fully understand, but also suit did a, quite "achievement" sense. Write it out and share it.
The original said a lot of principles, here is not to say (in fact, I do not understand). Here's how to write the procedure. The goal is to implement one of the simplest programs that can implement
There may be no one to use the method in the previous article for URL rewrite because the components that provide URL rewrite are already overwhelming.
Asp. Net-level URL rewrite component is simple enough to listen to the BeginR
, set Nginx to redirect to the/nginx-ie directory when the user uses IE:if ($http _user_agent ~ MSIE) {Rewrite ^ (. *) $/msie/$1 break;}Attached, commonly used nginx Rewrite rule configuration code.1, use only one URL, for example
IntroducedPeople often encounter such demand, an active page URL address is very long, promote product operation and user feedback is not easy to rememberNot beautiful, but temporarily no way to modify the code, this time can be used to rewrite. Or you now have a website upgrade to HTTPS now some users are still accessing HTTP you want to unify HTTPS, which can be implemented with
; } location ~. *\.
(gif|jpg|jpeg|png|bmp|swf) $ {expires 24h; Access_log off; } location ~. *\.
(JS|CSS) $ {expires 24h;
Access_log off;
}
You can restart your nginx.
Drupal Nginx Rewrite rulesDrupal is written in PHP language open source Content Management framework, is commonly known as CMS, many people are using Drupal to build their own blog, h
Introduction: Nginx rewrite rewrite rules and anti-theft chain configuration method, rewrite rule format flag tags in several forms, hotlinking return 403 error, allow the domain name directly following the second row of the domain name.
Nginx
The first few days of using the public platform, the developer tool can be configured callback address, some events through the address back to the developer. The URL needs to be authenticated the first time it is configured. Simply send a string of strings to the server specified by the URL, and then the server must return a string of strings, that is, echostr.
I'm going to use
rules of Apache and nginx are slightly different in URL redirection:
Apache rewrite rules:Rewriterule ^/html/tagindex/([A-Za-Z] +)/. * $/$1/[R = 301, l]
Nginx rewrite rules:Rewrite ^/html/tagindex/([A-Za-Z] +)/. * $ http: // $ host/$1/permanent;
In the above example, we not
/index.php?name=$1_$2 last;Rewrite ^/PINGCE ([0-9]*)/$/zl/pingce.php?id=$1 last;As can be seen from the above example, Apache rewrite rules changed to Nginx rewrite rules, in fact, very simple: Apache rewriterule instructions for Nginx r
After IIS7, Microsoft provided the URL rewrite version 2.0, which can be implemented by installing rewrite components. Applies to IIS7 or later versions.Installation can be selected in two ways, one is to download the installation files, and the second is to install through the "Web Platform Installer"1. Download the installation file: https://www.microsoft.com/z
Description
The difference between IIRF and Isapi_rewrite is that IIRF does not need to use the escape character \, and isapi_rewrite needs to use the escape character \.
introduce
IIRF is an open-source rewrite URL filter, similar to Apache URL rewrite, based on VC8.0 (which can be recompiled with visual Studio2
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.