客服联系方式

当前位置:首页 » 伪静态类 » 正文

wordpress伪静态规则支持中文标签httpd.ini

450 人参与  2025年05月17日 23:03  分类 : 伪静态类  评论

请将以下代码另存为httpd.ini存放在网站的web目录中,即可生效。(只适用于windows主机)

第一种

支持中文标签以及中文分类


[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# wordpress 伪静态规则
# For tag(中文标签以及标签翻页的规则)
RewriteRule /tag/(.*)/page/(\d+)$ /index\.php\?tag=$1&paged=$2
RewriteRule /tag/(.+)$ /index\.php\?tag=$1
# For category(中文分类以及分类翻页的规则)
RewriteRule /category/(.*)/page/(\d+)$ /index\.php\?category_name=$1&paged=$2
RewriteRule /category/(.*) /index\.php\?category_name=$1
# For sitemapxml
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]



第二种

通用伪静态


[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]


第三种

适用于iis 7.5或以上版本的wordpress伪静态规则(需要另存为web.config文件名)


<?xml version="1.0" encoding="UTF-8"?>
<configuration>
    <system.webServer>

<rewrite>
 <rules>

<rulename="Main Rule"stopProcessing="true">
<matchurl=".*"/>
<conditionslogicalGrouping="MatchAll">
<addinput="{REQUEST_FILENAME}"matchType="IsFile"negate="true"/>
<addinput="{REQUEST_FILENAME}"matchType="IsDirectory"negate="true"/>
<actiontype="Rewrite"url="index.php/{R:0}"/>

 </rule>
 </rules>
 </rewrite>
    </system.webServer>
</configuration>

来源:州运宝转载请保留出处和链接!

本文链接:https://www.zhouyunbao.com/8.html

本站部分内容来源网络如有侵权请联系删除

<< 上一篇 下一篇 >>

州运宝app建站备忘录

    州运宝|州运宝app|州运宝备忘录

州运宝 |

州运宝