In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
What this article shares to you is about whether the virtual host supports how to view rewrite. The editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
To see whether the virtual host supports rewrite, you can upload a 301 rule and test the pseudo-static rule. If it can be executed, it supports rewrite on behalf of the virtual host. At present, most virtual hosts support the rewrite function. Virtual hosts, for example, all support rewrite functions.
URL Rewrite, or URL rewriting, is the process of redirecting requests passed into Web to other URL. The main function of Rewirte is to realize the jump of URL and hide the real address, based on the regular expression specification of Perl language. Usually help us to achieve quasi-static, quasi-directory, domain name jump, prevent piracy and so on.
Rewrite action
1. Hide the programming language to improve security
When each page of the site is marked with a distinct development language such as .asp / .aspx / .php, people can see at a glance what language your site is made in. And when you change the language of the site, you need to change a lot of links. Also, when a page changes its extension, its pagerank disappears and starts from scratch. We can use UrlRewrite technology to hide our implementation details so that it is easy to modify and migrate without losing pagerank at all. Improving security can effectively prevent some parameter names and ID from being completely exposed to users. If users type indiscriminately, they will directly return a 404 or error page if they do not comply with the rules, which is much better than directly returning 500 or a lot of server error messages.
2. Improve the beauty and friendliness of search engines.
Dynamic URL is not only long but also difficult to promote, such as https://www.west.cn/docs/?p=58917, which has no sense of beauty. If you use the rewrite function, it can be simplified to: https://www.west.cn/docs/58917.html.
In addition, in theory, search engines prefer static pages, but relatively low scores for dynamic pages, static pages are conducive to improve inclusion.
An example of 301 rules in PHP language
The 301 rule of PHP is generally placed in the .htaccess file of the virtual host. The following is an example of how HTTP turns to HTTPS:
RewriteEngine OnRewriteCond% {HTTP:From-Https}! ^ on$ [NC] RewriteCond% {HTTP_HOST} ^ (www.)? abc.com$ [NC] # Jump abc.com and www.abc.com to https://www.abc.com, to prevent apache substations from inheriting the parent directory .htaccess is affected RewriteRule ^ (. *) $https://www.abc.com/$1 [Renew301jol] above is whether the virtual host supports rewrite how to view The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.