Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7698081
  • 博文数量: 637
  • 博客积分: 10265
  • 博客等级: 上将
  • 技术积分: 6165
  • 用 户 组: 普通用户
  • 注册时间: 2004-12-12 22:00
文章分类

全部博文(637)

文章存档

2011年(1)

2010年(1)

2009年(3)

2008年(12)

2007年(44)

2006年(156)

2005年(419)

2004年(1)

分类: 系统运维

2005-07-03 12:22:21

为了用户和代理把动态网页当成静态htm页面处理,便于缓存
koobi CMS 4.2.4 使用apache的mod_rewrite对URL进行改写,使用中需要主意的问题:

RewriteBase /
记得一定要修改,如果使用访问 koobi,那么改成
RewriteBase /koobi/

### correct some error by ELM
RewriteRule ^index.htm& index.php?area=1&p=index

RewriteRule ^forum_([0-9]+).htm& index.php?p=showforums&cid=$1
RewriteRule ^forum_([0-9]+)_print.htm& index.php?p=showforums&cid=$1&print=1

RewriteRule ^forum.htm& index.php?p=showforums [PT]

#RewriteRule ^index_([0-9]+).htm& index.php?area=$1
RewriteRule ^index_([0-9]+).htm& index.php?area=$1&p=index
RewriteRule ^index_([0-9]+)_print.htm& index.php?area=$1&p=index&print=1

RewriteRule ^changedetails_([0-9]+).htm& index.php?area=$1&p=changedetails
RewriteRule ^changepassword_([0-9]+).htm& index.php?area=$1&p=changepw
RewriteRule ^ignorelist_([0-9]+).htm& index.php?area=$1&p=ignorelist


## FORUM
RewriteRule ^topic_jump_([0-9]+)_([0-9]+)_([0-9]+).htm& index.php?p=showtopic&toid=$1&pp=$2&page=$3
RewriteRule ^topic_jump_([0-9]+)_([0-9]+)_([0-9]+)_print.htm& index.php?p=showtopic&toid=$1&pp=$2&page=$3&print=1

RewriteRule ^topic_([0-9]+)_.htm& index.php?p=showtopic&toid=$1&fid=
RewriteRule ^topic_([0-9]+)_([0-9]+).htm& index.php?p=showtopic&toid=$1&fid=$2
RewriteRule ^topic_([0-9]+)_([0-9]+)_print.htm& index.php?p=showtopic&toid=$1&fid=$2&print=1

RewriteRule ^showforums_sort_([0-9]+)_([_a-zA-Z0-9]+)_([_a-zA-Z0-9]+).htm& index.php?p=showforum&fid=$1&sortby=$2&sort=$3
RewriteRule ^showforums_sort_([0-9]+)_([_a-zA-Z0-9]+)_([_a-zA-Z0-9]+)_print.htm& index.php?p=showforum&fid=$1&sortby=$2&sort=$3&print=1

RewriteRule ^showforum_([0-9]+).htm& index.php?p=showforums&cid=$1
RewriteRule ^showforum_([0-9]+)_print.htm& index.php?p=showforums&cid=$1&print=1

RewriteRule ^showforums_([0-9]+).htm& index.php?p=showforum&fid=$1
RewriteRule ^showforums_([0-9]+)_print.htm& index.php?p=showforum&fid=$1&print=1

RewriteRule ^showtopic_([0-9]+).htm& index.php?p=showtopic&toid=$1
RewriteRule ^showtopic_([0-9]+)_print.htm& index.php?p=showtopic&toid=$1&print=1

RewriteRule ^showtopic_([0-9]+)_([0-9]+)_([0-9]+).htm& index.php?p=showtopic&toid=$1&pp=$2&page=$3
RewriteRule ^showtopic_([0-9]+)_([0-9]+)_([0-9]+)_print.htm& index.php?p=showtopic&toid=$1&pp=$2&page=$3&print=1


RewriteRule ^showtopic_([0-9]+).htm& index.php?p=showtopic&toid=254


## KONTAKT
RewriteRule ^contact_([0-9]+).htm& index.php?p=contact&area=$1
RewriteRule ^contact_([0-9]+)_print.htm& index.php?p=contact&area=$1&print=1


###################################### LINKS ########################################
RewriteRule ^links_([0-9]+).htm& index.php?p=links&area=$1
RewriteRule ^links_([0-9]+)_print.htm& index.php?p=links&area=$1&print=1
RewriteRule ^links_([0-9]+)_([0-9]+)_([0-9]+).htm& index.php?categ=$1&parent=$2&p=links&area=$3
RewriteRule ^links_([0-9]+)_([0-9]+)_([0-9]+)_print.htm& index.php?categ=$1&parent=$2&p=links&area=$3&print=1
RewriteRule ^links_rub_([0-9]+)_([0-9]+).htm& index.php?p=links&categ=$1&area=$2
RewriteRule ^links_rub_([0-9]+)_([0-9]+)_print.htm& index.php?p=links&categ=$1&area=$2&print=1
RewriteRule ^showlink_([0-9]+)([0-9]+)([0-9]+).htm& index.php?showlink=1&fid=$1&p=links&area=$2&categ=$3
RewriteRule ^showlink_([0-9]+)([0-9]+)([0-9]+)_print.htm& index.php?showlink=1&fid=$1&p=links&area=$2&categ=$3&print=1
RewriteRule ^linkssort_([a-zA-Z0-9]+)_([0-9]+)_([0-9]+)_([0-9]+).htm& index.php?sort=$1&categ=$2&parent=$3&p=links&area=$4
RewriteRule ^linkssort_([a-zA-Z0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_print.htm& index.php?sort=$1&categ=$2&parent=$3&p=links&area=$4&print=1

###################################### DOWNLOADS #####################################
RewriteRule ^downloads_([0-9]+).htm& index.php?p=downloads&area=$1
RewriteRule ^downloads_([0-9]+)_print.htm& index.php?p=downloads&area=$1&print=1
RewriteRule ^downloads_([0-9]+)_([0-9]+)_([0-9]+).htm& index.php?categ=$1&parent=$2&p=downloads&area=$3
RewriteRule ^downloads_([0-9]+)_([0-9]+)_([0-9]+)_print.htm& index.php?categ=$1&parent=$2&p=downloads&area=$3&print=1
RewriteRule ^download_rub_([0-9]+)_([0-9]+).htm& index.php?p=downloads&categ=$1&area=$2
RewriteRule ^download_rub_([0-9]+)_([0-9]+)_print.htm& index.php?p=downloads&categ=$1&area=$2&print=1
RewriteRule ^downloadfile_([0-9]+)_([0-9]+)_([0-9]+).htm& index.php?showfile=1&fid=$1&p=downloads&area=$2&categ=$3
RewriteRule ^downloadfile_([0-9]+)_([0-9]+)_([0-9]+)_print.htm& index.php?showfile=1&fid=$1&p=downloads&area=$2&categ=$3&print=1
RewriteRule ^downloadssort_([a-zA-Z0-9]+)_([0-9]+)_([0-9]+)_([0-9]+).htm& index.php?sort=$1&categ=$2&parent=$3&p=downloads&area=$4
RewriteRule ^downloadssort_([a-zA-Z0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)_print.htm& index.php?sort=$1&categ=$2&parent=$3&p=downloads&area=$4&print=1

RewriteRule ^download_rub_([0-9]+)_([0-9]+)_([0-9]+).htm&   index.php?nav=sub&p=downloads&categ=$1&area=$2&parent=$3
RewriteRule ^download_rub_([0-9]+)_([0-9]+)_([0-9]+)_print.htm&   index.php?nav=sub&p=downloads&categ=$1&area=$2&parent=$3&print=1
###################################### PN #####################################
RewriteRule ^pn_([0-9]+).htm& index.php?area=$1&p=pn
RewriteRule ^pn_([0-9]+)_print.htm& index.php?area=$1&p=pn&print=1

##################################### STATIC #####################################
RewriteRule ^static_(.*)_(.*).htm& index.php?area=$2&p=static&page=$1
RewriteRule ^static_(.*)_(.*)_print.htm& index.php?area=$2&p=static&page=$1&print=1

################################## MANUFACTURER #####################################
RewriteRule ^manufacturer_([0-9]+).htm& index.php?p=manufacturer&area=$1
RewriteRule ^manufacturer_([0-9]+)_print.htm& index.php?p=manufacturer&area=$1&print=1

################################### PRODUCTS #####################################
RewriteRule ^products_platform_([0-9]+)_([0-9]+).htm& index.php?p=product&area=$1&action=platforms&platform=$2
RewriteRule ^products_platform_([0-9]+)_([0-9]+)_print.htm& index.php?p=product&area=$1&action=platforms&platform=$2&print=1
RewriteRule ^showproduct_([0-9]+)_([0-9]+).htm& index.php?area=$1&p=product&action=showdetails&id=$2
RewriteRule ^showproduct_([0-9]+)_([0-9]+)_print.htm& index.php?area=$1&p=product&action=showdetails&id=$2&print=1
RewriteRule ^products_(.*)_([0-9]+).htm& index.php?p=product&action=$1&area=$2
RewriteRule ^products_(.*)_([0-9]+)_print.htm& index.php?p=product&action=$1&area=$2&print=1
RewriteRule ^productspf_(.*)_([0-9]+)_([0-9]+).htm& index.php?p=product&action=$1&platform=$2&area=$3
RewriteRule ^productspf_(.*)_([0-9]+)_([0-9]+)_print.htm& index.php?p=product&action=$1&platform=$2&area=$3&print=1
#RewriteRule ^products_choice_([a-zA-Z0-9]+)_([a-zA-Z0-9]+)_([a-zA-Z0-9]+).htm& index.php?p=product&area=$1&action=platforms&charakter=$2&platform=$3

##################################### FAQ #####################################
RewriteRule ^faq_([0-9]+).htm& index.php?p=faq&area=$1
RewriteRule ^faq_([0-9]+)_print.htm& index.php?p=faq&area=$1&print=1
RewriteRule ^faq_([0-9]+)_([0-9]+).htm& index.php?p=faq&faq_id=$1&area=$2
RewriteRule ^faq_([0-9]+)_([0-9]+)_print.htm& index.php?p=faq&faq_id=$1&area=$2&print=1

#################################### GALLERY #####################################
RewriteRule ^gallery_([0-9]+).htm& index.php?p=gallery&area=$1
RewriteRule ^gallery_([0-9]+)_print.htm& index.php?p=gallery&area=$1&print=1
RewriteRule ^galleryshow_([0-9]+)_([0-9]+).htm& index.php?p=gallery&action=showimages&galid=$2&area=$1
RewriteRule ^galleryshow_([0-9]+)_([0-9]+)_print.htm& index.php?p=gallery&action=showimages&galid=$2&area=$1&print=1
RewriteRule ^galleryshow_([0-9]+)_([0-9]+)_([0-9]+)_([a-zA-Z0-9]+)_([0-9]+).htm&  index.php?nav=1&p=gallery&action=showimages&galid=$1&area=$2&pp=$3&ascdesc=$4&page=$5

##################################### NEWS #####################################

RewriteRule ^newsarchive_(.*)_([0-9]+).htm& index.php?p=newsarchive&categ=$1&area=$2
RewriteRule ^newsarchive_(.*)_([0-9]+)_print.htm& index.php?p=newsarchive&categ=$1&area=$2&print=1

RewriteRule ^newsarchive_([0-9]+).htm& index.php?p=newsarchive&area=$1
RewriteRule ^newsarchive_([0-9]+)_print.htm& index.php?p=newsarchive&area=$1&print=1

RewriteRule ^news_([0-9]+)_(.*)_(.*)_(.*)_([0-9]+)_([0-9]+)_(.*)_(.*).htm& index.php?arc=1&p=newsarchive&area=$1&categ=$2&ud=$3&selby=$3&show=$4&pp=$5&page=$6&start=$7&end=$8
RewriteRule ^news_([0-9]+)_(.*)_(.*)_(.*)_([0-9]+)_([0-9]+)_(.*)_(.*)_print.htm& index.php?arc=1&p=newsarchive&area=$1&categ=$2&ud=$3&selby=$3&show=$4&pp=$5&page=$6&start=$7&end=$8&print=1


RewriteRule ^newsshow_([0-9]+)_([0-9]+).htm& index.php?p=index&categ=$1&area=$2
RewriteRule ^newsshow_([0-9]+)_([0-9]+)_print.htm& index.php?p=index&categ=$1&area=$2&print=1

RewriteRule ^news_([0-9]+)_([0-9]+)_(.*).htm& index.php?area=$1&p=news&newsid=$2&high=$3
RewriteRule ^news_([0-9]+)_([0-9]+)_(.*)_print.htm& index.php?area=$1&p=news&newsid=$2&high=$3&print=1

RewriteRule ^news_([0-9]+)_([0-9]+).htm& index.php?area=$1&p=news&newsid=$2
RewriteRule ^news_([0-9]+)_([0-9]+)_print.htm& index.php?p=news&area=$1&newsid=$2&print=1
RewriteRule ^news_page_([0-9]+)_([0-9]+)_([0-9]+).htm&  index.php?nav=1&area=$1&p=news&newsid=$2&artpage=$3
RewriteRule ^news_page_([0-9]+)_([0-9]+)_([0-9]+)_print.htm&  index.php?nav=1&area=$1&p=news&newsid=$2&artpage=$3&print=1

################################### ARTICLE #####################################
RewriteRule ^articlepage_([0-9]+)_([0-9]+)_([0-9]+).htm& index.php?nav=1&area=$1&p=product&action=showdetails&id=$2&artpage=$3
RewriteRule ^articles_([0-9]+).htm& index.php?p=articles&area=$1
RewriteRule ^articles_([0-9]+)_print.htm& index.php?p=articles&area=$1&print=1

RewriteRule ^articles_(.*)_([0-9]+)_([0-9]+)_(.*).htm& index.php?type=$1&area=$2&p=articles&id=$3&high=$4
RewriteRule ^articles_(.*)_([0-9]+)_([0-9]+)_(.*)_print.htm& index.php?type=$1&area=$2&p=articles&id=$3&high=$4&print=1

RewriteRule ^articles_(.*)_([0-9]+)_([0-9]+).htm& index.php?type=$1&area=$2&p=articles&id=$3
RewriteRule ^articles_(.*)_([0-9]+)_([0-9]+)_print.htm& index.php?type=$1&area=$2&p=articles&id=$3&print=1
RewriteRule ^articles_(.*)_([0-9]+)_([0-9]+)_print_(.*).htm& index.php?type=$1&area=$2&p=articles&id=$3&print=1&q=$4

RewriteRule ^articlescat_([0-9]+)_([0-9]+)_(.*).htm& index.php?p=articles&categ=$1&area=$2&type=$3
RewriteRule ^articlescat_([0-9]+)_([0-9]+)_(.*)_print.htm& index.php?p=articles&categ=$1&area=$2&type=$3&print=1

RewriteRule ^articlescat_([0-9]+)_([0-9]+).htm& index.php?p=articles&categ=$1&area=$2
RewriteRule ^articlescat_([0-9]+)_([0-9]+)_print.htm& index.php?p=articles&categ=$1&area=$2&print=1

RewriteRule ^rss/articles/([0-9]+)/([0-9]+).htm& rss/?rss=articles&pp=$1&area=$2
RewriteRule ^rss/articles/([0-9]+)/([0-9]+)/([0-9]+).htm& rss/?rss=articles&categ=$1&pp=$2&area=$3

RewriteRule ^user_([0-9]+)_([0-9]+).htm& index.php?p=user&id=$1&area=$2
RewriteRule ^product_([0-9]+)_([0-9]+)_showdetails.htm& index.php?area=$1&p=product&id=$2&action=showdetails
RewriteRule ^rss/news/([0-9]+)/([a-zA-Z0-9]+).htm& rss/?rss=news&pp=$1&area=$2
RewriteRule ^rss/news/([0-9]+)/([0-9]+)/([0-9]+).htm& rss/?rss=news&categ=$1&pp=$2&area=$3


RewriteRule ^index_([0-9]+)_(.*)_(.*)_(.*)_([0-9]+)_([0-9]+)_(.*)_(.*).htm& index.php?p=index&area=$1&categ=$2&ud=$3&selby=$3&show=$4&pp=$5&page=$6&start=$7&end=$8

###############################################################################
######## F躌 STARTSEITE, DIE OHNE AREA AUFGERUFEN WIRD (Multiple News) ########
RewriteRule ^index_([0-9]+)_([0-9]+)_([0-9]+).htm& index.php?p=index&page=$1&start=$2&end=$3
RewriteRule ^index_([0-9]+)_([0-9]+)_([0-9]+)_print.htm& index.php?p=index&page=$1&start=$2&end=$3&print=1

################################# MANUFACTURER #####################################
RewriteRule ^showmanufacturer_([0-9]+)_([0-9]+).htm& index.php?p=manufacturer&action=showdetails&area=$1&id=$2
RewriteRule ^showmanufacturer_sorted_([0-9]+)_([a-zA-Z0-9]+).htm& index.php?do=sort&p=manufacturer&area=$1&charakter=$2
RewriteRule ^manufacturer_([0-9]+).htm& index.php?p=manufacturer&area=$1

RewriteRule ^tellfriend_([0-9]+).htm& index.php?area=$1&p=tell&action=form
###END####

否则在访问论坛的时候出现该页没有找到的错误信息

阅读(3610) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~