防止某个页面被Google收录,只要在页面头上加入如下内容即可:
Adding a site to Sociable(添加自定义社会标签到Sociable中)
具体效果可查看:http://www.yong3g.com/
首先从http://yoast.com/wordpress/sociable/下载插件;
1. 下载16x16的图片到目录sociable/images/directory。
2. 打开 sociable.php。
3. 查找数组$sociable_known_sites。
4. Copy / paste the code for another site (they're in alphabetical order).
5. Change the value of favicon to the name of your image file.
代码:
# $url = "http://www.netps.cn";
# $ch = curl_init();
# curl_setopt($ch, CURLOPT_URL, $url);
# curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1、resource curl_init ( [string url])
The curl_init() will initialize a new session and return a CURL handle for use with the curl_setopt(), curl_exec(), and curl_close() functions. If the optional url parameter is supplied then the CURLOPT_URL option will be set to the value of the parameter. You can manually set this using the curl_setopt() function.
2、bool curl_setopt ( resource ch, string option, mixed value)
1、function nl2br($str)
功能:Inserts HTML line breaks before all newlines in a string
示例:<?php echo nl2br("foo isn't\n bar"); ?>
结果:\n会被HTML的换行替换
重定向可以被串联,老版本的RFC2616规定重定向最多不超过5次,一般使用时不要超过3次。
| 重定向状态代码 | ||
| 状态代码 | 描述 | 实现 |
| 300 | 多个选择 | |
| 301 | 永久转移 | .htaccess: RewriteRule ^foo\.php$ /bar.php [R=301,L] 或PHP(如果只有Location而没301状态,相当于302临时重定向): header('HTTP/1.1 301 Moved Permanently'); header('Location:http://www.netps.cn/bar.php'); |
RewriteEngine on
功能:打开url_rewriter功能,mod_rewrite
RewriteCond %{HTTP_HOST} !^www\.netps\.cn
RewriteRule ^(.*)$ http://www\.netps\.cn/$1 [R=301,L]
功能:把不是www.netps.cn的域名指向www.netps.cn
RewirteRule参数说明:
| RewirteRule 标记 | 含义 | 描述 |
| R | Redirect | 发出一个HTTP重定向 |
| F | Forbidden | 禁止对URL地址的存取 |
| G | Gone | 标记URL地址不存在 |
| P |
最新评论
5 周 9 小时之前
1 年 23 周之前
1 年 25 周之前