Apache implements simple reverse proxy through. htaccess

Source: Internet
Author: User

There are also many virtual hosts, especially LAMP hosts in foreign countries. There are a lot of small 500 M and 1g free resources in the hands of big stations can not be done, small stations do not want to do more?

It is also a waste in your hands. Today I will tell you a use plan. Use the idle Apache host to implement simple reverse proxy through. htaccess. It makes up for the regret that some hosts or website construction systems cannot bind domain names. Multiple fast virtual hosts provide slow site acceleration, polling, and smart resolution [CDN] effects.

The rules are as follows:

The code is as follows: Copy code

RewriteEngine On
RewriteBase/
RewriteRule ^ (. *) $ http://www.111cn.net/#1 [P]


First sentence: enable Rewrite mode
Second sentence: Directory of Rewrite
Third sentence: Reverse proxy www.111cn.net

Generally, Chinese hosts provide 2-level domain names. If you want to bind a domain name without record filing, you can achieve this method. Similar to hidden forwarding. Some other customers, such as Taobao customer content alliance, provide their second-level domain names or directories for free. They can use this method to bind them.

Multiple Apache hosts can perform round-robin acceleration or optimize for China Netcom and China Telecom. Of course, the effect of this implementation is definitely not as good as Squid or Nginx. If you are interested, you can study whether optimization can make the effect better?

You can use this method to hijack PR! Hey, go and set your own domain name for your website.

 

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.