首页建站经验 WordPress博客在Win空间上实现伪静态的方法

WordPress博客在Win空间上实现伪静态的方法

本文主要讲解WordPress博客在Win空间上实现伪静态的方法:1、写httpd.ini(写好后放在网站根目录下)[ISAPI_Rewrite]# 3600 = 1 hourCacheClockRate 3600RepeatLimit 32# Protect…

本文主要讲解WordPress博客在Win空间上实现伪静态的方法:

1、写httpd.ini(写好后放在网站根目录下)

[ISAPI_Rewrite]

# 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 throughRewriteRule /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]

2、如果博客地址含有中文,或标签是中文的,就会转到404页面,是通过httpd.ini解决不了的,必须来修改源代码。

修改网站目录下wp-includes/class-wp.php文件(请先行备份):

第一步:找到

$pathinfo = $_SERVER['PATH_INFO'];

修改为

$pathinfo = mb_convert_encoding($_SERVER['PATH_INFO'], ‘UTF-8′, ‘GBK’);

第二步:找到

$req_uri = $_SERVER['REQUEST_URI'];

修改为

$req_uri = mb_convert_encoding($_SERVER['REQUEST_URI'], ‘UTF-8′, ‘GBK’);

就这样,中文的TAG标签页等都可以打开了的。

以上就是关于WordPress博客在Win空间上实现伪静态的方法,希望对大家有所帮助。

本文来自网络,不代表1号站长-站长学院|资讯交流平台立场。转载请注明出处: https://www.1cn.cc/jianzhan/jingyan/18820.html
上一篇wordpress最新、热评和随机日志函数三体合一
下一篇 WordPress按分类显示文章的方法
admin

作者: admin

这里可以再内容模板定义一些文字和说明,也可以调用对应作者的简介!或者做一些网站的描述之类的文字或者HTML!

为您推荐

评论列表()

    联系我们

    联系我们

    0898-88888888

    在线咨询: QQ交谈

    邮箱: email@wangzhan.com

    工作时间:周一至周五,9:00-17:30,节假日休息

    关注微信
    微信扫一扫关注我们

    微信扫一扫关注我们

    关注微博
    返回顶部