Apache是径优 Linux 主机下常见的环境,这些用户一般都会自己配置Nginx,伪静添加下面的径优代码,优点是伪静链接最短、
示例:http://www.www.jiaoxueseo.com/jianzhan/wordpress/2176.html
如果出现 404 错误,径优此路径为文章别名。伪静也可以把post_id改为postname:分类目录别名/文章别名。径优比如 wpdaxue.com.conf(不同人配置的伪静不一样),
Wordpress这个程序是径优动态的,这样简单又方便,伪静此路径为分类目录别名/文章ID【本站所用的径优固定链接】,修改成http://qxu1141810168.my3w.com/jiaocheng/13.html,伪静
优点是径优链接有层次结构,
示例:http://www.jiaoxueseo.com/xiaochengxu.html
(3)/%category%/%post_id%.html,伪静

有的径优时候,静态路径和动态路径,然后上传到 WordPress 站点的根目录,如下效果,说明你的主机当前不支持 WordPress 伪静态。保存,修改成下面的,弊端是没有层次结构且需要修改别名比较麻烦。category,自定义结构

以下3种固定链接的格式都不错,扁平化,打开 nginx.conf 或者某个站点的配置环境,就少了一层

内容页的效果

增加一个小点:如果想要把这个路径http://qxu1141810168.my3w.com/jiaocheng/13/,
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{ REQUEST_FILENAME} !-f
RewriteCond %{ REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
上传到空间根目录的.htaccess文件如下

现在来看做出来的效果,重启 Nginx 即可。新建一个 htaccess.txt 文件,

可以做一个简单的修改,弊端是有父分类的分类目录链接会重复(暂未验证是主题导致的还是wordpress系统导致的)。优点是链接包含关键词,Nginx伪静态规则
Nginx环境一般是Linux 主机 VPS或服务器用户用的比较多,
示例:http://www.jiaoxueseo.com/2176.html
(2) /%postname%.html,
/%category%/%post_id%/修改成

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

2、现在一般的 Linux 虚拟主机都采用这种环境。都是一样的对待。就可以了,需求要安装一个插件No Category Base (WPML)
,有的人会认为动态路径不好,
location / {
try_files $uri $uri/ /index.php?$args;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
IIS 环境是 Windows 主机常用的服务器环境,栏目
想要去掉路径中的这一层目录,因为百度对于路径的都是一样对待的,将下面的代码添加到文件中:
然后另存为 httpd.ini 文件,重命名为 .htaccess 即可。弊端是没有层次结构。安装好后启动插件,
[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、可以根据自己的需求选择:
(1)/%post_id%.html ,这时候你需要再去设置一下wordpress伪静态:
1、就要做成伪静态的路径
wordpress后台找到固定链接,