Rewrite download using Apache module Rewrite_module go

Source: Internet
Author: User
Put
[url]http://wwww.aaaaaaaaa.com/...
To the address format instead of
[url]http://wwww.aaaaaaaaa.com/...
Or
[url]http://wwww.aaaaaaaaa.com/...
Of course, you can change according to your requirements.
Apache's Mod_rewrite module.
You can see a demo of a PHP learning forum
[url]http://www.phpx.com/happy/...
The Forum's layout and post, is the use of this technology, address static. But it's fake.
How good is this technology?
Can let Baidu, Google and other revenue of your site all pages.
The revenue address is your fake static address. Of course no one else can see that you are fake. And this technique hides the program behind you.
You can put
/soft/1234.html overrides passed to soft.php?id=1234
Of course, change your name to softxfewafew.php?id=1234.
The surface is still soft/1234.html but you Apache has executed your rewritten files internally.
It can fundamentally prevent others from invading the program itself.
Below I write how to rewrite. Divided into windows and LIUNX2 species
It's all operational.
Httpd.conf inside the Conf folder within the Apache installation folder
After opening, find
#LoadModule rewrite_module "Modules/mod_rewrite.so"
Get rid of the #.
Then find the virtual host configuration
Add to the virtual host
Rewriteengine on
Rewriterule ^/soft/([0-9]+). html$/soft.php?id=$1
Explain
WWW. Maize. com/soft/1234.html
Rewritten as
WWW. Maize. com/soft.php?id=1234
Here the ID is can be changed you give it 1 is pass 1
Rewriterule ^/([0-9]+). html$/soft.php?id=$1
Explain
WWW. Maize. com/1234.html
Rewritten as
WWW. Maize. com/soft.php?id=1234
Rewriterule ^/([0-9]+) _ ([0-9]+). html$/soft.php?id=$1&catid=$2
Explain
WWW. Maize. com/1234_2222.html
Rewritten as
WWW. Maize. com/soft.php?id=1234&catid=2222
Of course, whatever you want to change!
This is the win.
Liunx is the same, but to add
start
End
Overrides are added to the virtual host settings.
If there is no virtual host, add it at the end!

The above describes the rewrite download using the Apache module Rewrite_module, including the content of the rewrite download, I hope to be interested in PHP tutorial friends helpful.

  • 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.