windows主机下WordPress如何实现伪静态

随之长风
发布在 电脑网络

首先在建立一个文本文件,改名为,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 /favicon.ico /favicon.ico [L]
RewriteRule /robots.txt /robots.txt [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]
上传到网站根目录下,就可以实现伪静态了
如何你的网站下建有多少网站,需添加网站目录规则,
假设根目录下有个BLOG网站,将下面代码添加到合适位置即可。

RewriteRule /blog(.*) /blog$1 [L]

参与评论

请登录后操作...