使用CaptchaPlus插件给typecho添加评论验证码博客评论区本是读者们交流的地方,但总会防不住有垃圾评论的出现,它们多数由机器自动发送,因此添加人机验证便是防范机器人自动刷评论的好方法 一些主题(例如本博客之前使用过的Butterfly主题)自带了人机验证模块,只需要在主题设置中启用即可,但对于没有这个功能的主题就需要借助插件来实现CaptchaPlus插件在查找过许多人机验证插件后,博主认为最好用的一款是 CaptchaPlus 插件: Github 项目主页克隆或直接网页端打包下载,然后将 CaptchaPlus 文件夹上传到 Typecho 网站目录 /usr/plugins/ 文件夹进入博客后台,控制台-插件 中找到 CaptchaPlus 并启用打开 /usr/themes/ 你的主题目录下 comments.php 文件,在提交按钮前面/后面插入以下代码:<?php if (array_key_exists('CaptchaPlus', Typecho_Plugin::export()['activated']))
为Typecho、WordPress等博客框架开启伪静态去除链接中出现的index.php,并获得更好的SEONginx环境在nginx配置文件夹下(默认在/etc/nginx)进入sites-available,根据默认配置新建一个yourdomain.conf,在location /段加上# 伪静态重写 if (!-e $request_filename) { rewrite ^(.*)$ /index.php$1 last; } 或者try_files $uri $uri/ /index.php?$args;保存后将该文件链接到sites-enabled文件夹ln -s /etc/nginx/sites-available/yourdomain.conf /etc/nginx/sites-enabled/yourdomain.conf然后重启nginx即可Apache环境在网站根目录新建文件.htaccess,填入以下内容<IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{
wyj5211
某二幺幺大学牛马