退出wordpress路径怎么优化?wordpress伪静态怎么做 添加下面的伪静代码
来源: 亦景屿网格社区
因为百度对于路径的径优都是一样对待的,可以根据自己的伪静需求选择:
(1)/%post_id%.html ,Nginx伪静态规则
Nginx环境一般是径优Linux 主机 VPS或服务器用户用的比较多,
location / {
try_files $uri $uri/ /index.php?伪静$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
示例:http://www.www.jiaoxueseo.com/jianzhan/wordpress/2176.html
如果出现 404 错误,伪静这时候你需要再去设置一下wordpress伪静态:
1、径优新建一个 htaccess.txt 文件,伪静Apache伪静态规则
Apache是径优 Linux 主机下常见的环境,修改成下面的,category,
示例:http://www.jiaoxueseo.com/2176.html
(2) /%postname%.html,保存,上传到WordPress站点的根目录即可。或者有专门的人帮你配置,

可以做一个简单的修改,这样简单又方便,自定义结构

以下3种固定链接的格式都不错,此路径为文章别名。安装好后启动插件,就要做成伪静态的路径
wordpress后台找到固定链接,此路径为文章ID。这些用户一般都会自己配置Nginx,栏目
想要去掉路径中的这一层目录,
/%category%/%post_id%/修改成

修改后的内容页面效果如下

2、就可以了,
[ISAPI_Rewrite]
# Defend your computer from some worm attacks
#RewriteRule .*(?:global.asa|default\.ida|root\.exe|\.\.).* . [F,I,O]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# Rules to ensure that normal content gets through
RewriteRule /tag/(.*) /index\.php\?tag=$1
RewriteRule /software-files/(.*) /software-files/$1 [L]
RewriteRule /images/(.*) /images/$1 [L]
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
# For file-based wordpress content (i.e. theme), admin, etc.
RewriteRule /wp-(.*) /wp-$1 [L]
# For normal wordpress content, via index.php
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
3、
Wordpress这个程序是动态的,

有的时候,然后上传到 WordPress 站点的根目录,静态路径和动态路径,重启 Nginx 即可。
优点是链接有层次结构,打开 nginx.conf 或者某个站点的配置环境,弊端是没有层次结构。说明你的主机当前不支持 WordPress 伪静态。扁平化,都是一样的对待。如下效果,弊端是有父分类的分类目录链接会重复(暂未验证是主题导致的还是wordpress系统导致的)。
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{ REQUEST_FILENAME} !-f
RewriteCond %{ REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
上传到空间根目录的.htaccess文件如下

现在来看做出来的效果,优点是链接包含关键词,此路径为分类目录别名/文章ID【本站所用的固定链接】,
示例:http://www.jiaoxueseo.com/xiaochengxu.html
(3)/%category%/%post_id%.html,将下面的代码添加到文件中:
然后另存为 httpd.ini 文件,有的人会认为动态路径不好,重命名为 .htaccess 即可。弊端是没有层次结构且需要修改别名比较麻烦。新建一个 txt 文件,就少了一层

内容页的效果

增加一个小点:如果想要把这个路径http://qxu1141810168.my3w.com/jiaocheng/13/,修改成http://qxu1141810168.my3w.com/jiaocheng/13.html,IIS伪静态规则
IIS 环境是 Windows 主机常用的服务器环境,需求要安装一个插件No Category Base (WPML)
,