联系我们

4000 555 018
(7×24)
正睿服务器  >  新闻中心  >  技术文章
新闻中心

WordPress伪静态规则分享(window环境)

间隙填充
正睿科技  发布时间:2024-04-25 11:23:41  浏览数:18

[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 through
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]
    把此代码复制一份放到一个新建的txt中。把txt命名为httpd.ini 上传至网站根目录下。测试可以正常使用。
 
方法二:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
RewriteCond Host: ^leadkj\.com$
RewriteRule (.*) http\://www\.leadkj\.com$1 [I,RP]
# Rules to ensure that normal content gets through
RewriteRule /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]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
把此代码复制一份放到一个新建的txt中。把txt命名为httpd.ini 上传至网站根目录下。里面包含301跳转。

注意:后台固定链接自定义结构设置为 /archives-%post_id%.html   即可


  • 正睿合作伙伴
  • 社区
首页 | 注册 | 网站地图 | 通告 | 联系我们
CopyRight(C)2004-2022 Chongqing Zhengrui Technology Co.,Ltd. All rights reserved.
重庆正睿科技有限公司(C)版权所有 未经书面授权 不得转载、复制或建立镜像
渝ICP备11002339号-1  渝公网安备 50010702500475号