Use the Apache module rewrite_module

Source: Internet
Author: User

Set

<A href = "http://wwww.aaaaaaaaa.com/bbb.php? Id = 888 "target =" _ blank "> http://wwww.aaaaaaaaa.com/bbb.php? Id = 888 </a type = "codeph" text = "/codeph">

The address format is changed

<A href = "http://wwww.aaaaaaaaa.com/888.htm" target = "_ blank"> http://wwww.aaaaaaaaa.com/888.htm </a>

Or

<A href = "http://wwww.aaaaaaaaa.com/yourname/888.htm" target = "_ blank"> http://wwww.aaaaaaaaa.com/yourname/888.htm </a>

Of course you can change it as needed.

The mod_rewrite module of Apache.

You can see a demo of a PHP learning forum.

<A href = "http://www.phpx.com/happy/" target = "_ blank"> http://www.phpx.com/happy/ </a>

The layout and posts of this forum use this technology. Static addresses are fake.

Where is this technology good?

It can make Baidu, Google, and so on revenue to all pages of your site.

The revenue address is your fake static address. Of course others don't know that you are fake, and this technology hides the program running behind you.

You can

/Soft/1234.html rewrite to soft. php? Id = 1234

Of course, change the name to softxfewafew. php? Id = 1234

The surface is still soft/1234.html, but you have executed the file you have rewritten in Apache.

It can fundamentally prevent others from intruding into the program itself.

How can I rewrite the data below? Windows and liunx2

All operations

Httpd. conf In the conf folder of the Apache installation folder

After opening, find

# Loadmodule rewrite_module "modules/mod_rewrite.so"

Remove.

Then find the VM Configuration

Add to VM

Rewriteengine on

Rewriterule ^/soft/(%0-9%%%%%.html $/soft. php? Id = $1

// Explanation

// Www. Corn. com/soft/1234. html

// Rewrite

// Www. Corn. com/soft. php? Id = 1234

// Here the ID can be changed. If you give it 1, it is passed 1.

Rewriterule ^/(%0-9%%%%%.html

$/Soft. php? Id = $1

// Explanation

// Www. Corn. com/1234. html

// Rewrite

// Www. Corn. com/soft. php? Id = 1234

Rewriterule ^/(%0-9%%%%%_(%0-9%%%%%.html $/soft. php? Id = $1 & catid = $2

// Explanation

// Www. Corn. com/1234_2222.html

// Rewrite

// Www. Corn. com/soft. php? Id = 1234 & catid = 2222

Of course, you can change it as you like!

This is under Win.

Liunx is the same, but it must be added.

<Ifmodule mod_rewrite.c> Start

</Ifmodule> end

Rewrite is added to the VM settings.

If there is no Vm, add it to the end!

 

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.