In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Permanent page removal (301 redirection) is a very important "automatic redirection" technique. One of the most feasible ways to redirect a web address. When a user or search engine issues a browsing request to a web server, a status code in the header information (header) in the HTTP data stream returned by the server indicates that the web page is permanently transferred to another address.
In the construction of our website, we often encounter situations that require web page redirection: for example, the website is adjusted, the directory structure of the website is changed, and the page is moved to a new address. Or the web page extension is changed, such as changing .php to .HTML or .shtml due to the need of the application, in these cases, if there is no redirection, the old address in the user's favorites or search engine database can only let the visiting customer get a 404 page error message, and the access traffic will be lost in vain. For example, some websites that have registered multiple domain names also need to redirect users who visit these domain names to the main site automatically, and so on.
What scenarios does 301 redirect apply to?
1: when the website changes the domain name, the old domain name will be redirected to the new domain name through 301 permanent redirection to recover the traffic loss and SEO.
2: when you need to delete some directories in the site, such as I want to delete the blog navigation under my blog, you can use 301 to permanently redirect to the home page.
3: if you have multiple idle domain names and need to point to the same website, you can do so through 301 permanent redirection.
4: you intend to standardize URL.
There are several ways to achieve 301 redirection for your reference:
1) set the .htaccess file (for linux systems only, and need virtual host support. )
When you visit seoyj.com/, you will automatically go to www.seoyj.com.
Write the following code in the .htaccess file.
RewriteEngine onRewriteCond% {http_host} ^ seoyj.com [NC] RewriteRule ^ (. *) $http://www.seoyj.com/$1 [Lmaine Renew301]
Note: the URL standardized 301redirection (above code) needs to be written before other URL-rewrite code.
2) suitable for users using Unix system
Use this directive to notify the spider of the search engine that your site file is not under this address. This is a more common method.
Such as: _ Redirect 301 / http://www.seoyj.com
3) suitable for users using Windows system
Set url forwarding in the domain name management backend. Write seocs.net without www in the front and www.seocs.net with www in the back box, and set it to explicit forwarding. Explicit forwarding is equivalent to 301 and implicit forwarding is equivalent to 302, which is dangerous.
However, it is worth mentioning that because the concept of URL forwarding is different from 301, not all explicit forwarding is 301 (I heard that the url forwarding provided by Wanwang is 302). You can use the website Header information query tool provided by http://tool.alimama.com/tools.php to query baidu.com, if the return code has "HTTP/1.1 301 Moved Permanently". Congratulations, that's 301. Mine is the new network, the new network (xinnet) provides url explicit forwarding is 301, I used this method.
If you are a Wanwang and windows host, use the DNS alias to parse it.
4) use ASP/PHP to achieve 301 redirection:
ASP:
Response.Status= "301 Moved Permanently"
Response.AddHeader "Location", "http://www.baidu.com/""
Response.End
PHP:
Header ("HTTP/1.1 301 Moved Permanently")
Header ("Location: http://www.baidu.com/");"
Exit ()
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.