- 一、首页静态,其它页面伪静态的伪静态规则:
location / { rewrite ^/frim/index(.+?)\.html$ /list/index.php?$1 last; rewrite ^/movie/index(.+?)\.html$ /detail/index.php?$1 last; rewrite ^/play/([0-9]+)-([0-9]+)-([0-9]+)\.html$ /video/index.php?$1-$2-$3 last; rewrite ^/topic/index(.+?)\.html$ /topic/index.php?$1 last; rewrite ^/topic/index\.html$ /topic/index.php?$1 last; rewrite ^/topiclist/(.+?).html$ /topiclist/index.php?$1 last; rewrite ^/news/index\.html$ /news/index.php?$1 last; rewrite ^/html/part/index(.+?)\.html$ /articlelist/index.php?$1 last; rewrite ^/html/article/index(.+?)\.html$ /article/index.php?$1 last; } !!!别忘记了设置首页自动生成脚本
- 二、文件防意外修改、防挂马修改
在网站根目录安装Git来监视所有文件的修改记录,具体使用帮助自行搜索,下方列上常用的命令 apt install git cd www/root/ //网站根目录 git init git add . git commit -m 'first init' //自己主动修改文件后commit保存状态 git status //上次commit后 查看又有哪些文件被修改 git log //查看commit历史 设置.git目录www权限为000 设置.git rewrite : rewrite ^/.git/.*$ /index.html last; 几天后看访问日志,居然有人扫描.git目录偷源码 虽然吧 但是还是很不爽 所以把.git改到了wwwroot的父目录里 坏人真多
- 三、使用豆瓣分代替自评分
将模板里的[channellist:score]替换成[channellist:douban] [videolist:score]替换成[videolist:douban] 采集时判断douban=0则不入库,忘记修改哪个PHP文件了,有空我找一下记录是哪个文件哪一行。记得是“L”,全局搜索这个应该就能找到
- 四、自定义标签
例在详情页添加一个自定义标签{self:baidu_keyword}修改detail/index.php文件: $baiduKeyWord = $dsql->GetOne("Select kw From `百度词库表` where wd='$wd'"); ... $content=str_replace("{self:baidu_keyword}",$baiduKeyWord,$content); 生成html的时候也需要替换自定义标签 : 修改 mkhtml.func.php
- 五、视频生成html修改目录结构
修改 link.func.php 给生成的html文件放在一个总目录下,不和php混在一起 短路径 浅目录有助seo么? 可是那样项目太乱了。。。
- 六、升级11.9
哎 自己有改动 不太好升级了。。 加一个原版本分支 分支对比
- 七、添加电视直播
没找到采集源 mac电脑不支持火车头,也没折腾过火车头,算了 修改海洋自带的火车头的php文件 本地写脚本抓取数据对接上传 复制一份播放页和列表页模板 修改模板支持电视直播 http https不能混用 目前没有解决
- 八、提交搜索引擎
可以手动用后台的提交给百度 改一改也可以提交给其它搜索引擎 但我比较懒,还是改成网页有访问就提交给搜索引擎 1.修改模板 foot.html 添加引用 search_apply.js 新建文件:search_apply.js 内容: var xhrbing = new XMLHttpRequest(); xhrbing.open("GET", "/api/search_apply.php?url="+window.location.href, true); xhrbing.send(null); 2.新建文件 search_apply.php
百度和Bing之类的搜索引擎 google的文档我是没看明白。。。。有知道的不【捂脸】 ps 我不会js也不会php,纯改其它相似页面的代码
<?php
require_once('../data/config.cache.inc.php');
//接收相关参数
$url = addslashes($_GET['url']);
checkCache($url);
function checkCache($url = '')
{
try {
if (empty($url)) {
echo "url is empty";
} else if (empty(getCache($url))) {
setCache($url);
send($url);
} else {
echo "已存在:" . $url;
}
} catch (Exception $e) {
echo $e;
}
}
function getCache($p_cacheName)
{
global $cfg_cachemark, $cfg_redishost, $cfg_redisport, $cfg_redispsw;
$p_cacheName = $cfg_cachemark . $p_cacheName;
$redis = new redis();
$redis->connect($cfg_redishost, $cfg_redisport);
if ($cfg_redispsw != "") {
$redis->auth($cfg_redispsw);
}
return $redis->GET($p_cacheName);
}
function setCache($p_cacheName)
{
global $cfg_cachemark, $cfg_redishost, $cfg_redisport, $cfg_redispsw;
$p_cacheName = $cfg_cachemark . $p_cacheName;
$redis = new redis();
$redis->connect($cfg_redishost, $cfg_redisport);
if ($cfg_redispsw != "") {
$redis->auth($cfg_redispsw);
}
$redis->set($p_cacheName, '1');
}
function send($url)
{
// baidu
$baiduApi = 'http://data.zz.baidu.com/urls?site=https://www.baidu114.cc/&token=your_key';
$ch = curl_init();
$options = array(
CURLOPT_URL => $baiduApi,
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array('Content-Type: text/plain'),
CURLOPT_TIMEOUT => 15
);
curl_setopt_array($ch, $options);
$result = curl_exec($ch);
// curl_close($ch);
// bing
$bingApi = 'https://www.bing.com/indexnow?url=' . $url . '&key=your_key';
// $chb = curl_init();
$optionsb = array(
CURLOPT_URL => $bingApi,
CURLOPT_HTTPGET => true,
CURLOPT_TIMEOUT => 15,
CURLOPT_HTTPHEADER => array('Content-Type: application/json; charset=utf-8'),
);
curl_setopt_array($ch, $optionsb);
$resultb = curl_exec($ch);
// indexnow
// $bingApi = 'https://api.indexnow.org/indexnow?url=' . $url . '&key=your_key';
// $chb = curl_init();
// $optionsb = array(
// CURLOPT_URL => $bingApi,
// CURLOPT_HTTPHEADER => array('Content-Type: application/json; charset=utf-8'),
// );
// curl_setopt_array($chb, $optionsb);
// $resultb = curl_exec($chb);
//
// // seznam
// $bingApi = 'https://search.seznam.cz/indexnow?url=' . $url . '&key=your_key';
// $chb = curl_init();
// $optionsb = array(
// CURLOPT_URL => $bingApi,
// CURLOPT_HTTPHEADER => array('Content-Type: application/json; charset=utf-8'),
// );
// curl_setopt_array($chb, $optionsb);
// $resultb = curl_exec($chb);
//
// // yandex
// $bingApi = 'https://yandex.com/indexnow?url=' . $url . '&key=your_key';
// $chb = curl_init();
// $optionsb = array(
// CURLOPT_URL => $bingApi,
// CURLOPT_HTTPHEADER => array('Content-Type: application/json; charset=utf-8'),
// );
// curl_setopt_array($chb, $optionsb);
// $resultb = curl_exec($chb);
curl_close($ch);
echo "indexnow: " . $bingApi . $resultb;
}
?>
九、增加标签云
上线后三天,索引量直线上升 【叉腰笑】
后台:
前台展现标签云:
这样改完。。。因现在的cms不是以git方式提供的,升级是个大问题。。。
大佬们,换个链吧,私
最后于 1月前
被mmmmmmm编辑
,原因:
收藏的用户(0)
X
正在加载信息~
最新回复 (12)