"Really is an essay" How to use htaccess to bring website traffic to a page (Site Maintenance page effect)

Source: Internet
Author: User

Cuckoo goo, a long time not to blog Park around, recently (this recently good long AH) has not been a lot of times to write Bo (in fact, do not know what to write something), so has been diving,,, (omitted here n word)

OK cut to the chase, about how the site of all traffic to a page of methods have many, such as WordPress can open maintenance mode or install a plug-in, thinkphp should be able to set a route in front of it (I did not try, just estimate can), But a more convenient way for Apache is to write. htaccess. But there is a lot of information on how to write online, but how I searched is wrong (put the directory direct 500 or redirect cycle, I am African?) ), so after groping to finally find the appropriate code, the code is as follows

#/close.html Replace the page you need to redirect past Rewriteengine Onrewritecond%{request_uri}!/close.html$# 123.123.123.123 is not going to jump IP, there is a need to try , but if there is a CDN or a reverse generation in front of the server, don't think about it. Rewritecond%{remote_addr}!^123\.123\.123\.123rewriterule $/close.html [r=302,l]# Blog Park No. htaccess of rendering rules

Save. Htaccess root directory

"Really is an essay" How to use htaccess to bring website traffic to a page (Site Maintenance page effect)

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.