- 工信部备案号 滇ICP备05000110号-1
- 滇公网安备53011102001527号
- 增值电信业务经营许可证 B1.B2-20181647、滇B1.B2-20190004
- 云南互联网协会理事单位
- 安全联盟认证网站身份V标记
- 域名注册服务机构许可:滇D3-20230001
- 代理域名注册服务机构:新网数码
- CN域名投诉举报处理平台:电话:010-58813000、邮箱:service@cnnic.cn
wordpress默认的链接是动态的形式,大家都喜欢搞搞SEO,变换下链接地址,于是wordpress伪静态就登场了。伪静态的链接更具有层级结构关系,更有利于蜘蛛抓取,不同的web环境伪静态链接规则也不一样,整理了几种,方便大家参考。 apache环境下的wordpress伪静态规则
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]新建一个.htaccess文件并将以上代码写入.htaccess文件中,上传至wordpress站点的根目录中。 IIS环境下的wordpress伪静态规则 方法1、打开站点根目录下的web.config文件并加入以下代码:
方法2、新建一个httpd.ini文件并加入以下代码:
[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 /sitemap.xml.gz /sitemap.xml.gz [L] RewriteRule /robots.txt /robots.txt [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]
上传至wordpress站点根目录。
nginx环境下的wordpress伪静态方法
location / {
index index.html index.php;
if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}
}将以上代码加入到nginx.conf文件的Server段内。 这是目前比较流行的几种web配置的伪静态规则。
售前咨询
售后咨询
备案咨询
二维码

TOP