西部数码网站助手,wordpress,伪静态,测试已经通过
1:首先 在建立网站的时候伪静态组件选择自定义,然后进入网站目录比如D:\wwwroot\wp1111\others
这里建立的网站也就是FTP帐号wp111 进入里面的others文件夹里面有个httpd.conf文件,这个就是伪静态文件.我们记事本打开进去编辑他
先把他里面的东西全部删除掉,然后复制下面的代码粘贴进去保存
RegistrationName= wlqcwin
RegistrationCode= 2EAD-35GH-66NN-ZYBA
# # 形式:/PostID.html
# # 自定义链接 /%post_id%.html
#RewriteRule /(about|contact|about-copyright|favor|archives|tags|sitemap|taotao) /index\.php\?pagename=$1
RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
RewriteRule /category/?(.*) /index\.php\?category_name=$1
RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2
RewriteRule /author/?(.*) /index\.php\?author_name=$1
RewriteRule /feed/?$ /index.php?feed=rss2
RewriteRule /comments/feed/?$ /index.php?feed=comments-rss2
RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
# RewriteRule /([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
# RewriteRule /([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
RewriteRule /([0-9]+).html /index\.php\?p=$1
RewriteRule /page/(.*)/?s=(.*) /index\.php\?s=$2&paged=$1
RewriteRule /page/(.*) /index\.php\?paged=$1
RewriteRule /date/([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/?([0-9]+)?/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5
RewriteRule /date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
RewriteRule /date/([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
RewriteRule /([0-9]+).html/(feed|rdf|rss|rss2|atom) /index\.php\?feed=rss2&p=$1
RewriteRule /([0-9]+).html/trackback /wp-trackback\.php\?p=$1
#标签
RewriteRule /tag/(.*)/page/(\d+)$ /index\.php\?tag=$1&paged=$2
RewriteRule /tag/(\d+)$ /index\.php\?tag=$
RewriteRule /software-files/(.*) /software-files/$1 [L]
RewriteRule /sitemap.xml /sitemap.xml [L]
RewriteRule /favicon.ico /favicon.ico [L]
RewriteRule /wp-(.*) /wp-$1 [L]
RewriteRule ^/$ /index.php [L]
RewriteRule /(.*) /index.php/$1 [L]
2、此时可能会出现中文TAG无法找到的问题,解决办法如下:打开wp-include目录下的“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');
3、保存文件,现在刷新网站看看效果吧,所有操作完成。
附:wordpress自定义结构相关规则说明
%year% 文章发表的年份,四位数,如 2004
%monthnum% 月份,如 05
%day% 天,如 28
%hour% 小时,如 15
%minute% 分钟 如 43
(责任编辑:电脑知识大全)
|
------分隔线----------------------------