Redirect and redirect websites to external links
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
<A href = "http://www.100sucai.com"> All The Way </a>
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:
<A href = "http://www.100sucai.com" rel = "nofollow"> All The Way </a>
Here, we will share with you that the external link address is redirected. That is, if the external link address is a http://www.100sucai.com, through redirection, it becomes http: // your site address/go. php? Url = http://www.100sucai.com is still accessing the http://www.100sucai.com of the target website
First downloadGo. Zip fileDecompress the go. php file and upload it to the root directory of your website. Then replace the http://www.100sucai.com in go. php with your website address. Finally, you only need to change the link address from <a href = "http: // XXXX "... replace with <a href = "/go. php? Url = http: // XXXX. Now, the external link address can be converted. In Emlog, the code for modifying the reviewer's website is as follows:
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 ):
<A href = "'. $ comment ['url'].'" target = "_ blank">
Replace it:
<A href = "/go. php? Url = '. $ comment ['url'].' "target =" _ blank ">
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.