A5下载 - 努力做内容最丰富最安全的下载站!

A5站长下载站

当前位置:A5下载 > 源码技巧 > wordpress > WordPress博客在Win空间上实现伪静态的方法

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

时间:2015-10-16 13:45作者:fang人气:113

本文主要讲解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空间上实现伪静态的方法,希望对大家有所帮助。

标签WordPress,博客,Win,空间,实现,静态,方法,本

相关下载

查看所有评论+

网友评论

网友
您的评论需要经过审核才能显示

热门阅览

最新排行

公众号