Urlrewriter Component Usage Instructions manual

Source: Internet
Author: User
Tags manual ini regular expression

Urlrewriter Component Usage Instructions manual

: All users have the same action

: Different depending on user requirements

: Problems that may occur after a user installs a component

Urlrewrite Introduction

What is Urlrewrite?

Urlrewri

Using URLR

Why use Urlrewrite:

1 deal with situations where you want to change the structure of your Web pages, but you also make sure that the old URLs that are collected will not become dead links when you move the pages.

overriding URLs

2 Next can hide the programming language that the website uses, can also improve the portability of the website.

When each page of the site is hung with a distinct. asp/.aspx/.php the markup of this development language, others can see what language your site is made of. And in changing the site's

Language, you need to change a lot of links. Also, when a page modifies an extension, its PageRank disappears, starting from scratch. We can use Urlrewrite.

Technology hides our implementation details, so it's convenient to modify the porting and not lose PageRank at all.

3) The most important

Web page's ur

Installation

SETP 1: Copy test files

1. Before copying the test documents, we should build a good asp,php,asp.net.

2. Copy the test files of the Urlrewrite components in the D:netcnnetcn_urlrewritetest directory to the Web site root directory

3. Then use the http://domain name/urlrewrite.html access the site, through the page prompts test isapi_rewrite whether the installation was successful.

SETP 2: Modify Httpd.ini file, user add rule

Modify the D:netcnnetcn_urlrewritehttpd.ini file to add the Rewriter rule:

Note: 1. Please back up before modifying Httpd.ini;

2. Rewrite rules here need to be added according to the needs of the user's Web site, and the rules need to have regular expression knowledge of the personnel settings.

#测试页面

#规则1

Rewriterule/test.html/test.asp

#规则2

rewriterule/tags/([0-9]+)/tags.php?tags=$1

#规则3

rewriterule/article/([0-9]+)/([_0-9a-z-]+)/article.aspx?id=$1&title=$2

Description

Each rule starts with a rewriterule and is case-sensitive.

Then the space followed by the static address to be converted, generally by the address name + regular expression combination

And then the actual URL address. Parameter $n: Represents the content of n () positive expression matching;

Rewrite rules match in order;

Rule one: Change the URL similar to http://localhost/test.html:

Http://localhost/test.asp

Rule number two: turn a URL similar to http://localhost/tags/id:

Http://localhost/tags.php?tags=id

Rule three: Turn a URL similar to Http://localhost/article/342/some-article-title:

Http://localhost/article.aspx?id=342&title=some-article-title

4) Httpd.ini file can be effective after saving

5) URLR

SETP 3: Testing

Specific reference to "use effects"

Problems that may arise:

Question one:

Many people will find that their images and CSS stylesheet references sometimes stop working when they first use the URL rewrite.

Reason:

This is because they have a relative reference to these files on the Web page, and when you start rewriting URLs in your application, you need to realize that browsers are often on different layers of logical hierarchies

(logical hierarchy levels) requests the file, not what is actually stored on the server.

Suggestions:

1. The path of the referenced picture and file in the Web page, please use absolute path

Question two:

If the test file is displayed correctly, the rules written by the user do not work.

Reason:

If the user writes a rule that is not correct, ask the user to modify the test.

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.