In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
This article uses easy-to-understand examples to introduce the method of apache forcing 301 and https to jump at the same time, the code is very detailed, interested friends can refer to, I hope it can be helpful to you.
Apache is a Web server software, has a variety of products, can support SSL technology, support multiple virtual hosts. It is fast, reliable and can compile interpreters such as Perl/Python into the server through a simple API extension.
Apache is characterized by simplicity, high speed, stable performance, and can be used as a proxy server. It can run in most computer operating systems and is widely used because of its cross-platform and security.
First, force WWW to jump
RewriteEngine onRewriteCond% {HTTP_HOST} ^ cainiaoqidian\ .com [NC] RewriteRule ^ (. *) $http://www.cainiaoqidian.com/$1 [LMagne Renew301 NC]
Add to the pseudo-static file and take effect immediately.
Second, mandatory HTTPS format
Because the HTTPS encryption format URL is also popular and necessary, so I am also considering and adjusting to add the HTTPS format URL, after all, there are more free SSL certificates, the addition is not complex, just after the test, it is OK, but also need to be forced to jump HTTPS, because HTTP and HTTPS had better be unique.
RewriteEngine OnRewriteCond% {SERVER_PORT} 80RewriteRule ^ (. *) $https://www.cainiaoqidian.com/$1 [Rmael]
Similarly, you can add a forced HTTPS jump to the .htaccess file.
Third, add 301 jump, two kinds of rules are configured at the same time
RewriteEngine OnRewriteCond% {HTTP_HOST}! ^ cainiaoqidian.com$ [NC] RewriteRule ^ (. *) $https://cainiaoqidian.com/$1 [L mae Romeo 301] RewriteCond% {SERVER_PORT} 80RewriteRule ^ (. *) $https://cainiaoqidian.com/$1 [L mae R é 301]
If we have friends who prefer to use the format without WWW, we can also force jump without WWW and HTTPS without WWW.
RewriteEngine onRewriteCond% {HTTP_HOST} ^ cainiaoqidian\ .com [NC] RewriteRule ^ (. *) $http://cainiaoqidian.com/$1 [LMagneRome301MagneNC] this is how apache forces 301 and https to jump at the same time. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.