Teach you to the Nick M type virtual host set 301 redirect

Source: Internet
Author: User
Keywords Virtual host virtual host anti-Nick 301 redirect

&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Virtual Host Settings 301 Redirect is one of the topics of entry-level webmaster concerns, because this setting involves the development of code, and the online tutorials are a lot of vague, so many webmasters do not know how to start. Small series in order to give you an example tutorial, take the best Nick host Carnival on the best-selling m-type virtual host to do an example, teach you how to set 301 redirect. If your host is not a M-type host, as long as the virtual space Support 301 redirect function on the type. Specifically you can also consult your website space provider, they will tell you.

In fact, in the M-type host space Control Panel is not set 301 redirect Function button, want to take the Web site without www to jump to the Web site with WWW Smart in the FTP space provider set up. Here the small part of the first to say 301 redirect principle, with the help of Baidu Encyclopedia to provide the answer said: "301 redirect also called the page permanent removal, is a very important" automatic steering technology. Web site redirection is one of the most feasible approaches. When a user or search engine sends a browse request to a Web server, one of the status codes in the header (header) of the HTTP data stream returned by the server indicates that this page is permanently transferred to another address. ”

What's the benefit of setting 301 redirects? Most webmaster know, search engine only through IP access stable virtual space and read the content of the site, in search engine eyes, not with WWW url is the main domain name. If you do not set the primary domain name, search engine results will default to show the Web site without www. and the webmaster for various considerations want to start with WWW Web site as the main domain name, so 301 redirect function was born.

Just buy M-type master machine small set is also very confused, I searched the entire virtual host Control Panel also failed to find the 301 redirection Settings button, because the host provider customer service explicitly told me that can be setup. As a combination of Baidu found in the tutorial in the background set a pass, incredibly successful. See Tutorials:

First of all, you need a. htaccess file, this file can go to Baidu search download, download the end of. htaccess file is opened with Notepad, write the following code:

Deny from all
ErrorDocument 404/404.html
Options +followsymlinks
Rewriteengine on
Rewritecond%{http_host} ^****.com$ [NC]
Rewriterule ^ (. *) $ http://www.****.com/$1 [r=301,l]

Let me first analyze this piece of code, the deny from the all represents the prohibition to download and view the htaccess files on the virtual host, this is for web security reasons. ErrorDocument 404/404.html is the code that sets the 404 page, and the remaining code is 301 to code again. After you understand the internal structure of the. htaccess file, upload the htaccess file to the root directory of the M-type virtual host space using the FTP tool. You can use webmaster tools such as the love station to see if you have successfully set 301 redirects.

Set 301 redirect requires the virtual host server to configure the relevant components, if the corresponding components are configured to do not have much problem, upload the above. htaccess file can achieve 301 functions, in the purchase of virtual host must ask the host space whether the function is configured, or can not be successfully set.
M-Type virtual host: Http://www.iisp.com/vhost/m.php?s=sorunme

Related Article

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.