Redirect to external links

Source: Internet
Author: User
This article mainly introduces redirection to external links. For more information about PHP tutorials, see. In the comments function of Emlog, message recipients can enter their own website addresses. However, in many cases, we do not want our website to have too many messy external links. Of course, we can add the nofollow attribute to the link. That is, the original link code is

All the Way

When we add the rel = "nofollow" attribute to this link, we will tell the search engine that the link address should not pass the weight. Shape:

All the Way

Here, we will share with you that the external link address is redirected. That is, if the external link address is a https://www.php1.cn, through redirection, it becomes http: // your site address/go. php? Url = https://www.php1.cn is still accessing the https://www.php1.cn of the target website

First download the go.zip file to decompress the go. php file and upload it to the root directory of your website. then replace the https://www.php1.cn in go. php with your website address. Finally, you only need

After modifying and uploading go. php to the root directory, open the module. php file of the template and find the following code in the comment list (the methods for each version are similar, and the location may be different ):

 

Replace it:

 

You can complete the redirection and conversion of the Emlog blog comments URL. In one step, you can also open robot.txt and add the following code to the project to reject the redirection of external links being indexed by the search engine! : Disallow:/go. php? Url = *

Note: When go. php is enabled, you can also set whether to directly jump. if $ directGo is set to false, an external link webpage is loaded using a framework.

The above introduces redirection to the external link of the website, including the content, hope to be helpful to friends who are interested in the PHP Tutorial.

Related articles:

Three methods for php page redirection

PHP redirection and pseudo-static

Two methods to redirect URL parameters in JavaScript

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.