WordPress在window2003 IIS ISAPI ReWrite下的URL規(guī)則
更新時間:2007年10月10日 23:09:03 作者:
為了便于搜索引擎抓取(換句話就是假靜態(tài)),下面是URL ReWrite的規(guī)則,效果看我的chinadigger的鏈接地址。我目前的Rewrite規(guī)則:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# WordPress rewrite rules#
RewriteRule /tag/(.*)/ /index\.php\?tag=$1
RewriteRule /(about-me|about-copyright|guest-book)/ /index\.php\?pagename=$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/?$ /wp-feed\.php/\?feed=rss2
RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
RewriteRule /page/(.*)/ /index\.php\?paged=$1
RewriteRule /photo/?([^/]*)?/?([^/]*)?/?([^/]*)?/?([^/]*)?/?$ /wp-content/plugins/fgallery/fim_photos\.php\?$1=$2&$3=$4 [QSA,L,I]
RewriteRule /photo/?(.*) /wp-content/plugins/fgallery/fim_photos\.php\?$1=$2&$3=$4 [QSA,L,I]
# /%year%%monthnum%%day%/%postname%/
RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
RewriteRule /category/?(.*)/ /index\.php\?category_name=$1
RewriteRule /([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 /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
RewriteRule /([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
RewriteRule /([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /index\.php\?year=$1&monthn&day=$3&name=$4&feed=$5
RewriteRule /([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/trackback/?$ /wp-trackback\.php\?year=$1&monthnum=$2&day=$3&name=$4&tb=1
# /post/%post_id%.html
RewriteRule /([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
# RewriteRule /post/([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
RewriteRule /post/([0-9]+).html /index\.php\?p=$1 [I]
RewriteRule /post/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
RewriteRule /post/category/?(.*)/ /index\.php\?category_name=$1
RewriteRule /post/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 /post/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
RewriteRule /post/date/([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
使用方法(將Wordpres安裝在根目錄)
去discuz.net的論壇下載Rewrite的壓縮包,然后按照安裝方法在IIS里面配置好Rewrite,用上面的規(guī)則覆蓋httpd.ini中原來的內(nèi)容,再到wordpress的后臺,將選項的永久鏈接部分,使用自定義,然后在框框里面填寫上面粗體部分的內(nèi)容(兩種選一種,其中# /post/%post_id%.html還不太完善),即可。
本文引用bluefeel所寫的規(guī)則。原文中TAG編寫有問題,我已經(jīng)更改完畢,大家要注意寫法,否則會影響其他IIS站點目錄。
復制代碼 代碼如下:
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
# WordPress rewrite rules#
RewriteRule /tag/(.*)/ /index\.php\?tag=$1
RewriteRule /(about-me|about-copyright|guest-book)/ /index\.php\?pagename=$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/?$ /wp-feed\.php/\?feed=rss2
RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2
RewriteRule /page/(.*)/ /index\.php\?paged=$1
RewriteRule /photo/?([^/]*)?/?([^/]*)?/?([^/]*)?/?([^/]*)?/?$ /wp-content/plugins/fgallery/fim_photos\.php\?$1=$2&$3=$4 [QSA,L,I]
RewriteRule /photo/?(.*) /wp-content/plugins/fgallery/fim_photos\.php\?$1=$2&$3=$4 [QSA,L,I]
# /%year%%monthnum%%day%/%postname%/
RewriteRule /category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
RewriteRule /category/?(.*)/ /index\.php\?category_name=$1
RewriteRule /([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 /([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
RewriteRule /([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
RewriteRule /([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ /index\.php\?year=$1&monthn&day=$3&name=$4&feed=$5
RewriteRule /([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/trackback/?$ /wp-trackback\.php\?year=$1&monthnum=$2&day=$3&name=$4&tb=1
# /post/%post_id%.html
RewriteRule /([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
# RewriteRule /post/([0-9]+)/?([0-9]+)?/?$ /index\.php\?p=$1&page=$2
RewriteRule /post/([0-9]+).html /index\.php\?p=$1 [I]
RewriteRule /post/category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2
RewriteRule /post/category/?(.*)/ /index\.php\?category_name=$1
RewriteRule /post/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 /post/date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4
RewriteRule /post/date/([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3
使用方法(將Wordpres安裝在根目錄)
去discuz.net的論壇下載Rewrite的壓縮包,然后按照安裝方法在IIS里面配置好Rewrite,用上面的規(guī)則覆蓋httpd.ini中原來的內(nèi)容,再到wordpress的后臺,將選項的永久鏈接部分,使用自定義,然后在框框里面填寫上面粗體部分的內(nèi)容(兩種選一種,其中# /post/%post_id%.html還不太完善),即可。
本文引用bluefeel所寫的規(guī)則。原文中TAG編寫有問題,我已經(jīng)更改完畢,大家要注意寫法,否則會影響其他IIS站點目錄。
您可能感興趣的文章:
- 在CentOS 6 中安裝 WordPress(二)安裝WordPress
- 8個出色的WordPress SEO插件收集
- WordPress入門指南-wordpress安裝使用說明
- 在CentOS 6 中安裝WordPress(一) 安裝Apache,Mysql, PHP環(huán)境
- WordPress判斷用戶是否登錄的代碼
- wordpress主題支持自定義菜單及修改css樣式實現(xiàn)方法
- WordPress導入數(shù)據(jù)庫出現(xiàn)”Unknown collation: ‘utf8mb4_unicode_ci”錯誤的解決辦法
- Nginx下讓WordPress支持固定鏈接的偽靜態(tài)規(guī)則
- 用js代碼和插件實現(xiàn)wordpress雪花飄落效果的四種方法
- PHP版本升級到7.x后wordpress的一些修改及wordpress技巧
- 修改WordPress中文章編輯器的樣式的方法詳解
- WordPress 照片lightbox效果的運用幾點
- 在CentOS系統(tǒng)上從零開始搭建WordPress博客的全流程記錄
- 基于wordpress主題制作的具體實現(xiàn)步驟
- 解決安裝wordpress時出現(xiàn)ERR_TOO_MANY_REDIRECTS重定向次數(shù)過多問題
相關文章
防止aspxspy木馬列服務 iis信息 執(zhí)行命令提權(quán)等操作
處于安全考慮,對服務器安全進行設置。上傳aspxspy測試2012-11-11
Windows Server 2012搭建文件服務器的詳細步驟
這篇文章主要介紹了Windows Server 2012搭建文件服務器的步驟,本文一步步通過圖文并茂的形式給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2021-09-09

