这是本文档旧的修订版!


在Kloxo中设置伪静态

首先请区别伪静态功能伪静态规则,在Kloxo中Apache和Lighttpd均已经启用伪静态功能。
需要根据网站程序添加进对应的伪静态规则才能正常使用伪静态功能。同一个网站程序在不同服务器软件下的伪静态规则不同。

(1)Apache环境

直接将.htaccess文件传至网站根目录即可。
由于Apache使用较为广泛,绝大多数网站程序的Apache伪静态规则可以在官方网站或者论坛找到。如果没有请自行Google。

(2)Lighttpd环境

伪静态设置页面位置如下图,添加完伪静态需要需要重启Web服务器


常用程序的Lighttpd伪静态规则

WordPress

url.rewrite = (
"^/(wp-.+).*/?" => "$0",
"^/(sitemap.xml)" => "$0",
"^/(xmlrpc.php)" => "$0",
"^/(.+)/?$" => "/index.php/$1"
)


WordPress MU(多用户)

url.rewrite-once = (
"^/(.*)?/?files/$" => "index.php",
"^/(.*)?/?files/(.*)" => "wp-content/blogs.php?file=$2",
"^/([_0-9a-zA-Z-]+/)?(wp-.*)" => "$2",
"^/([_0-9a-zA-Z-]+/)?(.*\.php)$" => "$2",
"." => "index.php"
)


Discuz(程序放在网站根目录,如bbs.diavps.cn)

url.rewrite-once = (
"^/archiver/((fid|tid)-[\w\-]+\.html)$" => "archiver/index.php?$1",
"^/forum-([0-9]+)-([0-9]+)\.html$" => "forumdisplay.php?fid=$1&page=$2",
"^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" => "viewthread.php?tid=$1&extra=page=$3&page=$2",
"^/space-(username|uid)-(.+)\.html$" => "space.php?$1=$2",
"^/tag-(.+)\.html$" => "tag.php?name=$1"
)


Discuz(程序放在网站子目录,如www.diavps.cn/bbs,如果子目录名不是bbs,请将下面规则中的bbs修改为你的子目录名)

url.rewrite-once = (
"^/bbs/archiver/((fid|tid)-[\w\-]+\.html)$" => "bbs/archiver/index.php?$1",
"^/bbs/forum-([0-9]+)-([0-9]+)\.html$" => "bbs/forumdisplay.php?fid=$1&page=$2",
"^/bbs/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" => "bbs/viewthread.php?tid=$1&extra=page=$3&page=$2",
"^/bbs/space-(username|uid)-(.+)\.html$" => "bbs/space.php?$1=$2",
"^/bbs/tag-(.+)\.html$" => "bbs/tag.php?name=$1"
)


DiscuzX2

url.rewrite = (
"^/topic-(.+)\.html$" => "/portal.php?mod=topic&topic=$1",
"^/article-([0-9]+)-([0-9]+)\.html$" => "/portal.php?mod=view&aid=$1&page=$2",
"^/forum-(\w+)-([0-9]+)\.html$" => "/forum.php?mod=forumdisplay&fid=$1&page=$2",
"^/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$" => "/forum.php?mod=viewthread&tid=$1&extra=page=$3&page=$2",
"^/group-([0-9]+)-([0-9]+)\.html$" => "/forum.php?mod=group&fid=$1&page=$2",
"^/space-(username|uid)-(.+)\.html$" => "/home.php?mod=space&$1=$2",
"^/blog-([0-9]+)-([0-9]+)\.html$" => "/home.php?mod=space&uid=$1&do=blog&page=$2",
"^/archiver-(fid|tid)-([0-9]+)\.html$" => "/archiver/index.php?action=$1&page=$2",
"^/([a-z]+)-(.+)\.html$" => "/$1.php?rewrite=$2"
)


zencart 1.3.9h(基于ultimate seo urls 2.101,需要安装ultimate seo urls 2.101)

url.rewrite-once = (
"^/page_(.*)\.html$"=>"index.php?main_page=page_$1",
"^/(.*)-p-(.*)\.html(\?(.*))?$" => "/index.php?main_page=product_info&products_id=$2&$4",
"^/(.*)-c-(.*)\.html(\?(.*))?$" => "/index.php?main_page=index&cPath=$2&$4",
"^/(.*)-pi-([0-9]+)\.html(\?(.*))?$" => "/index.php?main_page=popup_image&pID=$2&$4",
"^/(.*)-m-([0-9]+)\.html(\?(.*))?$" => "/index.php?main_page=index&manufacturers_id=$2&$4",
"^/(.*)-pr-([0-9]+)\.html(\?(.*))?$" => "/index.php?main_page=product_reviews&product_id=$2&$4",
"^/(.*)-pri-([0-9]+)\.html(\?(.*))?$" => "/index.php?main_page=product_reviews_info&product_id=$2&$4",
"^/login\.html(\?(.*))?$" => "/index.php?main_page=login&$2",
"^/shopping_cart\.html(\?(.*))?$" => "/index.php?main_page=shopping_cart&$2",
"^/checkout_shipping\.html(\?(.*))?$" => "/index.php?main_page=checkout_shipping&$2",
"^/privacy\.html(\?(.*))?$" => "/index.php?main_page=privacy&$2",
"^/shippinginfo\.html(\?(.*))?$" => "/index.php?main_page=shippinginfo&$2",
"^/conditions\.html(\?(.*))?$" => "/index.php?main_page=conditions&$2",
"^/contact_us\.html(\?(.*))?$" => "/index.php?main_page=contact_us&$2",
"^/site_map\.html(\?(.*))?$" => "/index.php?main_page=site_map&$2",
"^/gv_faq\.html(\?(.*))?$" => "/index.php?main_page=gv_faq&$2",
"^/discount_coupon\.html(\?(.*))?$" => "/index.php?main_page=discount_coupon&$2",
"^/unsubscribe\.html(\?(.*))?$" => "/index.php?main_page=unsubscribe&$2",
"^/products_new\.html(\?(.*))?$" => "/index.php?main_page=products_new&$2",
"^/products_all\.html(\?(.*))?$" => "/index.php?main_page=products_all&$2",
"^/advanced_search\.html(\?(.*))?$" => "/index.php?main_page=advanced_search&$2",
"^/advanced_search_result\.html(\?(.*))?$" => "/index.php?main_page=advanced_search_result&$2",
"^/password_forgotten\.html(\?(.*))?$" => "/index.php?main_page=password_forgotten&$2",
"^/info_shopping_cart\.html(\?(.*))?$" => "/index.php?main_page=info_shopping_cart&$2",
"^/popup_search_help\.html(\?(.*))?$" => "/index.php?main_page=popup_search_help&$2",
"^/popup_shipping_estimator\.html(\?(.*))?$" => "/index.php?main_page=popup_shipping_estimator&$2",
"^/product_reviews_write\.html(\?(.*))?$" => "/index.php?main_page=product_reviews_write&$2",
"^/product_reviews\.html(\?(.*))?$" => "/index.php?main_page=product_reviews&$2",
"^/tell_a_friend\.html(\?(.*))?$" => "/index.php?main_page=tell_a_friend&$2",
"^/create_account\.html(\?(.*))?$" => "/index.php?main_page=create_account&$2",
"^/create_account_success\.html(\?(.*))?$" => "/index.php?main_page=create_account_success&$2",
"^/account\.html(\?(.*))?$" => "/index.php?main_page=account&$2",
"^/logoff\.html(\?(.*))?$" => "/index.php?main_page=logoff&$2",
"^/account_edit\.html(\?(.*))?$" => "/index.php?main_page=account_edit&$2",
"^/address_book\.html(\?(.*))?$" => "/index.php?main_page=address_book&$2",
"^/address_book_process\.html(\?(.*))?$" => "/index.php?main_page=address_book_process&$2",
"^/account_password\.html(\?(.*))?$" => "/index.php?main_page=account_password&$2",
"^/account_newsletters\.html(\?(.*))?$" => "/index.php?main_page=account_newsletters&$2",
"^/reviews\.html(\?(.*))?$" => "/index.php?main_page=reviews&$2"
)
最后更改: in 2011/07/09 22:19