In the Emlog comment function, the message person can fill in the website address. But there are times when we don't want to have too many cluttered external links on our site. Of course, we can add the nofollow attribute to the link. That is, the link code is
<a href= "http://www.php.cn" > Along the Journey </a>
When we add the rel= "nofollow" attribute to this link, we tell the search engine that the link address does not pass the weight. Shaped like:
<a href= "http://www.php.cn" rel= "nofollow" > Along the Journey </a>
And here, along the journey with you, is to redirect the address of the outside chain. That is, if the outer chain address is http://www.php.cn, through redirection, it becomes http://Your website address/go.php?url=http://www.php.cn still visit the target site http://www.php.cn
First download the Go.zip file to extract the go.php file to the root directory of your website, and then replace the http://www.php.cn in go.php with your website address. Finally, you only need to change the link address in your website from <a href= "Http://XXXX" ... Replace with <a href= "/go.php?url=http://xxxx to complete the conversion of the outer chain address. In Emlog, the change code for the reviewer URL is as follows:
After completing the go.php modification and uploading to the root directory, open the template's module.php file and find the following code in the comments list (similar to each version method, the exact location may be different):
<a href= "'. $comment [' url ']. '" target= "_blank" >
Replace it with:
<a href= "/go.php?url=". $comment [' url ']. ' target= ' _blank ' >
You can complete the redirect conversion to the Emlog Blog reviewer URL link. Further, you can also open robot.txt in the following line add the code below to reject the redirected external link being indexed by the search engine! : Disallow:/go.php?url=*
Additional Note: Open go.php, you can also set whether it is a direct jump, $directGo set to False, a framework to load the outer chain page.
The above describes the Web site to redirect the chain, including the aspects of the content, I hope that the PHP tutorial interested in a friend helpful.
Related articles:
Three ways to redirect PHP pages
PHP redirection vs. pseudo-static differences
Summary of two methods for JavaScript redirection URL parameters