Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

IIS 7.5 uses the simple settings of the URL Rewrite module to achieve web page redirection

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

We all know that Apache can easily set rewrite for web pages or websites in configuration files, but recently took over a set of IIS servers and found that there is simply no configuration file for me to write, but I want to implement the function of web page rewrite. How to do, google for a while, decisively found the content.

IIS URL Rewrite module:

Official download address:

Http://www.iis.net/downloads/microsoft/url-rewrite

Official documentation:

Http://www.iis.net/learn/extensions/url-rewrite-module/using-the-url-rewrite-module

Download the installation package to the IIS server, install, it will automatically detect the installation location of IIS, very simple until the end of the finish, and then re-open IIS Manager, you will clearly see a component in the directory of each website: URL Rewrite!

Double-click to enter its rules panel:

You can click Add rule directly in the upper right corner to add rules.

Here we simply do a rewrite.

Goal:

When the user accesses www.a.com/aaa, it automatically accesses the file named aaa.html.

Achieve:

Click Add rule, then select Blank rule, and then fill in the rules as shown in the figure:

Name: give it a name, and we call it "set aaa to aaa.html" here.

Requested URL: select 'matching pattern' (Matches the pattern)

Using: choose 'exact match' (Exact Match) (if your regular expression (Regular Expressions) is good enough, you can also use regular matching)

Pattern: enter the matching content 'aaa' (since it is an exact match, we only need to enter the exact matching content)

Action type: select rewrite.

Rewrite URL: enter the aaa.html we need

Click the Apply in the upper right corner and save it.

IIS has supported this URL Rewrite module since 7. 0, which can define not only the redirection of a single link, but also the redirection of the entire directory, which is powerful and easy to use. It is highly recommended for everyone to use!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report