前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >IIS下wordpress伪静态的配置

IIS下wordpress伪静态的配置

作者头像
老高的技术博客
发布2022-12-27 15:45:24
1.5K0
发布2022-12-27 15:45:24
举报
文章被收录于专栏:老高的技术博客

IIS服务器下伪静态的配置需要参照Apache.htaccess文件。 首先要使IIS支持URL Rewrite,所以必须让服务器加载ISAPI\_Rewrite! 什么是ISAPI\_Rewrite? ISAPI 翻译为:英特网服务器应用编程接口。

最常用的用途是URL Rewrite,辅助动态网站(主要为PHP脚本的程序)实现伪静态功能。

IIS支持ISAPI后就剩下两个步骤了:

1.建立一个httpd.ini文件,文件内容如下:

代码语言:javascript
复制
[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]
RewriteRule /sitemap_baidu.xml /sitemap_baidu.xml [L]
RewriteRule /sitemap.html /sitemap.html [L]
RewriteRule /archivers/(.*) /archivers/$1 [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.wordpress后台固定链接设置为:  

代码语言:javascript
复制
/%post_id%.html

搞定,撒花吧~

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2014-05-10,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档