Babel on FreeBSD

来自开放百科 - 灰狐
跳转到: 导航, 搜索

前面的准备工作与apache无异.

lighttpd.conf修改: 最底下加

include "v2ex_rewrite.conf"

v2ex_rewrite.conf内容:

=====start

server.modules += ("mod_rewrite")
url.rewrite = (
"^/$" => "/babel.php?m=home",
"^/([0-9]+)$" => "/babel_mobile.php?m=home&p=$1",
"^/index.html$" => "/babel.php?m=home",
"^/hot.html$" => "/babel.php?m=hot",
"^/home/style/shuffle.html$" => "/babel.php?m=home&style=shuffle",
"^/home/style/remix.html$" => "/babel.php?m=home&style=remix",
"^/home/style/shuffle$" => "/babel.php?m=home&style=shuffle",
"^/home/style/remix$" => "/babel.php?m=home&style=remix",
"^/home/style/remix/([a-zA-Z0-9\-]+)$" => "/babel.php?m=home&style=remix&go=$1",
"^/remix/([a-zA-Z0-9\-]+)$" => "/babel.php?m=home&style=remix&go=$1",
"^/q/(.+)/([0-9]*).html$" => "/babel.php?m=search&q=$1&p=$2",
"^/q/(.+)$" => "/babel.php?m=search&q=$1",
"^/session/stats.vx$" => "/babel.php?m=session_stats",
"^/search/listener.vx$" => "/babel_sl.php?m=search",
"^/search.vx$" => "/babel.php?m=search",
"^/savepoint/erase/([0-9]+).vx$" => "/babel_sl.php?m=savepoint_erase&savepoint_id=$1",
"^/feed/v2ex.rss$" => "/babel_feed.php?m=home",
"^/feed/board/([a-zA-Z0-9\-]+).rss$" => "/babel_feed.php?m=board&board_name=$1",
"^/feed/board/([a-zA-Z0-9\-]+)$" => "/babel_feed.php?m=board&board_name=$1",
"^/feed/user/(.+)$" => "/babel_feed.php?m=user&user_nick=$1",
"^/feed/geo/(.+)$" => "/babel_feed.php?m=geo&geo=$1",
"^/feed/topic/(.+).rss$" => "/babel_feed.php?m=topic&topic_id=$1",
"^/feed/ing$" => "/babel_feed.php?m=ing_public",
"^/feed/ing/friends/([^\/]+)$" => "/babel_feed.php?m=ing_friends&user_nick=$1",
"^/feed/ing/([^\/]+)$" => "/babel_feed.php?m=ing_personal&user_nick=$1",
"^/me/([0-9]+)$" => "/babel.php?m=user_home&do=me&msg=$1",
"^/me$" => "/babel.php?m=user_home&do=me",
"^/u/(.+)$" => "/babel.php?m=user_home&user_nick=$1",
"^/g/(.+)$" => "/babel.php?m=user_graphic&user_nick=$1",
"^/dry/(.+)$" => "/babel_dry.php?m=home&user_nick=$1",
"^/ing$" => "/babel.php?m=ing_public",
"^/ing/([^\/]+)/friends$" => "/babel.php?m=ing_friends&u=$1",
"^/ing/([^\/]+)$" => "/babel.php?m=ing_personal&u=$1",
"^/js/ing/([^\/]+)$" => "/babel_sl.php?m=js_ing_personal&u=$1",
"^/js/ing/([^\/]+)/gbk$" => "/babel_sl.php?m=js_ing_personal&u=$1&oe=gbk",
"^/ojs/ing/([^\/]+)$" => "/babel.php?m=ojs_ing_personal&u=$1",
"^/geo/(.+)$" => "/babel.php?m=geo_home&geo=$1",
"^/zen$" => "/babel.php?m=zen",
"^/zen/(.+)$" => "/babel.php?m=zen&user_nick=$1",
"^/zen2$" => "/babel.php?m=zen2",
"^/zen2/(.+)$" => "/babel.php?m=zen2&user_nick=$1",
"^/api/zen2/delete/project/([0-9]+)/from/active$" => 
"/babel_sl.php?m=api_zen2_delete_project&project_id=$1&area=active",
"^/api/zen2/delete/project/([0-9]+)/from/done$" => 
"/babel_sl.php?m=api_zen2_delete_project&project_id=$1&area=done",
"^/api/zen2/done/project/([0-9]+).([0-9]+)$" =>  
"/babel_sl.php?m=api_zen2_done_project&project_id=$1&rand=$2",
"^/api/zen2/undone/project/([0-9]+).([0-9]+)$" =>  
"/babel_sl.php?m=api_zen2_undone_project&project_id=$1&rand=$2",
"^/api/zen2/load/projects/active$" => "/babel_sl.php?m=api_zen2_load_projects_active",
"^/api/zen2/load/projects/active/([0-9]+)$" =>   
"/babel_sl.php?m=api_zen2_load_projects_active&user_id=$1",
"^/api/zen2/load/projects/done$" => "/babel_sl.php?m=api_zen2_load_projects_done",
"^/api/zen2/load/projects/done/([0-9]+)$" => "/babel_sl.php?m=api_zen2_load_projects_done&user_id=$1",
"^/project/view/([0-9]+).html$" => "/babel.php?m=project_view&project_id=$1",
"^/friend/connect/(.+)$" => "/babel.php?m=user_home&user_nick=$1&do=add",
"^/friend/remove/(.+)$" => "/babel.php?m=user_home&user_nick=$1&do=remove",
"^/status.vx$" => "/babel.php?m=status",
"^/jobs/kijiji.html$" => "/babel.php?m=jobs_kijiji",
"^/rules.vx$" => "/babel.php?m=rules",
"^/terms.vx$" => "/babel.php?m=terms",
"^/privacy.vx$" => "/babel.php?m=privacy",
"^/policies.vx$" => "/babel.php?m=policies",
"^/community_guidelines.vx$" => "/babel.php?m=community_guidelines",
"^/partners.vx$" => "/babel.php?m=partners",
"^/out_of_money.vx$" => "/babel.php?m=out_of_money",
"^/signup.html$" => "/babel.php?m=signup",
"^/user/logins.html$" => "/babel.php?m=user_logins",
"^/user/create.vx$" => "/babel.php?m=user_create",
"^/user/modify.vx$" => "/babel.php?m=user_modify",
"^/user/update.vx$" => "/babel.php?m=user_update",
"^/user/move.vx$" => "/babel.php?m=user_move",
"^/user/move/(.+)$" => "/babel.php?m=user_move&geo=$1",
"^/user/settle/([a-zA-Z0-9\-\_]+)$" => "/babel_sl.php?m=user_settle&geo=$1",
"^/recv/portrait.vx$" => "/babel_sl.php?m=recv_portrait",
"^/recv/savepoint.vx$" => "/babel_sl.php?m=recv_savepoint",
"^/recv/ing.vx$" => "/babel_sl.php?m=recv_ing",
"^/erase/ing/([0-9]+).vx$" => "/babel_sl.php?m=erase_ing&ing_id=$1",
"^/recv/zen/project.vx$" => "/babel_sl.php?m=recv_zen_project",
"^/change/zen/task/done/([0-9]+).vx$" => "/babel_sl.php?m=change_zen_task_done&zen_task_id=$1",
"^/change/zen/project/permission/([0-9]+).vx$" =>  
"/babel_sl.php?m=change_zen_project_permission&zen_project_id=$1",
"^/erase/zen/project/([0-9]+).vx$" => "/babel_sl.php?m=erase_zen_project&zen_project_id=$1",
"^/recv/zen/task/([0-9]+).vx$" => "/babel_sl.php?m=recv_zen_task&zen_project_id=$1",
"^/erase/zen/task/([0-9]+).vx$" => "/babel_sl.php?m=erase_zen_task&zen_task_id=$1",
"^/undone/zen/task/([0-9]+).vx$" => "/babel_sl.php?m=undone_zen_task&zen_task_id=$1",
"^/login/(.+)$" => "/login.php?r=$1",
"^/login.vx$" => "/login.php",
"^/login$" => "/login.php",
"^/logout.vx$" => "/login.php?do=logout",
"^/logout$" => "/login.php?do=logout",
"^/passwd/(.+)$" => "/babel.php?m=passwd&k=$1",
"^/passwd.vx$" => "/babel.php?m=passwd",
"^/channel/view/([0-9]*).html$" => "/babel.php?m=channel_view&channel_id=$1",
"^/go/([a-zA-Z0-9\-]+)$" => "/babel.php?m=board_view&board_name=$1",
"^/go/([a-zA-Z0-9\-]+)/$" => "/babel.php?m=board_view&board_name=$1",
"^/who/fav/node/([a-zA-Z0-9\-]+)$" => "/babel.php?m=who_fav_node&node_name=$1",
"^/who/fav/topic/([a-zA-Z0-9\-]+)$" => "/babel.php?m=who_fav_topic&topic_id=$1",
"^/who/settle/([a-zA-Z0-9\-\_]+)$" => "/babel.php?m=who_settle_geo&geo=$1",
"^/who/settle/([a-zA-Z0-9\-\_]+)/([0-9]+).html$" => "/babel.php?m=who_settle_geo&geo=$1&p=$2",
"^/who/connect/([^\/]+)$" => "/babel.php?m=who_connect_user&user_nick=$1",
"^/who/connect/([^\/]+)/([0-9]+).html$" => "/babel.php?m=who_connect_user&user_nick=$1&p=$2",
"^/board/view/([0-9]*)/([0-9]*).html$" => "/babel.php?m=board_view&board_id=$1&p=$2",
"^/board/view/([0-9]*).html$" => "/babel.php?m=board_view&board_id=$1",
"^/section/view/([0-9]*).html$" => "/babel.php?m=section_view&section_id=$1",
"^/topic/top.html$" => "/babel.php?m=topic_top",
"^/topic/fresh.html$" => "/babel.php?m=topic_fresh",
"^/topic/fresh/([0-9]*).html$" => "/babel.php?m=topic_fresh&p=$1",
"^/topic/archive/user/([^\/]+)$" => "/babel.php?m=topic_archive_user&user_nick=$1",
"^/topic/archive/user/([^\/]+)/([0-9]+).html$" => "/babel.php?m=topic_archive_user&user_nick=$1&p=$2",
"^/topic/favorite.vx$" => "/babel.php?m=topic_favorite",
"^/topic/favorite/([0-9]*).vx$" => "/babel.php?m=topic_favorite&p=$1",
"^/t/([0-9]+)$" => "/babel_mobile.php?m=topic&topic_id=$1",
"^/t/([0-9]+)/([0-9]+)$" => "/babel_mobile.php?m=topic&topic_id=$1&p=$2",
"^/topic/view/([0-9]*)/([0-9]*).html$" => "/babel.php?m=topic_view&topic_id=$1&p=$2",
"^/topic/view/([0-9]*).html$" => "/babel.php?m=topic_view&topic_id=$1",
"^/topic/new/([0-9]*).vx$" => "/babel.php?m=topic_new&board_id=$1",
"^/topic/create/([0-9]*).vx$" => "/babel.php?m=topic_create&board_id=$1",
"^/topic/latest.html$" => "/babel.php?m=topic_latest",
"^/topic/answered/latest.html$" => "/babel.php?m=topic_answered_latest",
"^/post/modify/([0-9]*).vx$" => "/babel.php?m=post_modify&post_id=$1",
"^/post/update/([0-9]*).vx$" => "/babel.php?m=post_update&post_id=$1",
"^/topic/modify/([0-9]*).vx$" => "/babel.php?m=topic_modify&topic_id=$1",
"^/topic/update/([0-9]*).vx$" => "/babel.php?m=topic_update&topic_id=$1",
"^/topic/erase/([0-9]*).vx$" => "/babel.php?m=topic_erase&topic_id=$1",
"^/topic/move/([0-9]*).vx$" => "/babel.php?m=topic_move&topic_id=$1",
"^/topic/move/([0-9]*)/to/([0-9]+)$" => "/babel_sl.php?m=topic_move_to&topic_id=$1&board_id=$2",
"^/post/create/([0-9]*).vx$" => "/babel.php?m=post_create&topic_id=$1",
"^/post/erase/([0-9]*).vx$" => "/babel.php?m=post_erase&post_id=$1",
"^/post/create/mobile/([0-9]*).vx$" => "/babel_mobile.php?m=post_create&topic_id=$1",
"^/expense/view/([0-9]*).vx$" => "/babel.php?m=expense_view&p=$1",
"^/expense/view.vx$" => "/babel.php?m=expense_view",
"^/online/view/([0-9]+).vx$" => "/babel.php?m=online_view&p=$1",
"^/online/view.vx$" => "/babel.php?m=online_view",
"^/who/join/([0-9]+).html$" => "/babel.php?m=who_join&p=$1",
"^/who/join.html$" => "/babel.php?m=who_join",
"^/c/([0-9]*).([0-9]*).png$" => "/c.php",
"^/fav/latest.html$" => "/babel.php?m=fav_latest",
"^/fav/topic/add/([0-9]*).vx$" => "/babel_ajax.php?m=fav_topic_add&topic_id=$1",
"^/fav/node/add/([0-9]*).vx$" => "/babel_ajax.php?m=fav_node_add&node_id=$1",
"^/fav/channel/add/([0-9]*).vx$" => "/babel_ajax.php?m=fav_channel_add&channel_id=$1",
"^/fav/remove/([0-9]*).vx$" => "/babel_ajax.php?m=fav_remove&fav_id=$1",
"^/message/home.vx$" => "/babel_pm.php?m=home",
"^/message/compose.vx$" => "/babel_pm.php?m=compose",
"^/message/compose/([0-9]*).vx$" => "/babel_pm.php?m=compose&user_id=$1",
"^/message/create.vx$" => "/babel_pm.php?m=create",
"^/message/inbox.vx$" => "/babel_pm.php?m=inbox",
"^/message/inbox/([0-9]*).vx$" => "/babel_pm.php?m=inbox&p=$1",
"^/message/sent.vx$" => "/babel_pm.php?m=sent",
"^/message/sent/([0-9]*).vx$" => "/babel_pm.php?m=sent&p=$1",
"^/message/view/([0-9]*).vx$" => "/babel_pm.php?m=view&message_id=$1",
"^/message/remove/([0-9]*).vx$" => "/babel_sl.php?m=remove_message&message_id=$1",
"^/api/topic/create.vx$" => "/babel_api.php?m=topic_create",
"^/mobile.html$" => "/babel.php?m=mobile",
"^/mobile/([0-9]+)$" => "/babel.php?m=mobile&no=$1",
"^/man.html$" => "/babel.php?m=man",
"^/ref/(.+)$" => "/babel.php?m=man&q=$1",
"^/babel/code.html$" => "/babel.php?m=site&site=babel&page=code",
"^/babel/downloads.html$" => "/babel.php?m=site&site=babel&page=downloads",
"^/babel/license.html$" => "/babel.php?m=site&site=babel&page=license",
"^/babel/links.html$" => "/babel.php?m=site&site=babel&page=links",
"^/d/uid/([0-9]*)$" => "/babel_sl.php?m=disable_uid&user_id=$1",
"^/dt/uid/([0-9]*)$" => "/babel_sl.php?m=erase_zero_topic_uid&user_id=$1",
"^/json/home/tab/latest$" => "/babel_sl.php?m=json_home_tab_latest",
"^/json/home/tab/section/([0-9]+)$" => "/babel_sl.php?m=json_home_tab_section&section_id=$1",
"^/new_features.html$" => "/babel.php?m=new_features",
"^/timtowtdi.html$" => "/babel.php?m=timtowtdi",
"^/auth$" => "/babel_auth.php",
"^/auth.vx$" => "/babel_auth.php",
"^/exit$" => "/babel_exit.php",
"^/exit.vx$" => "/babel_exit.php",
"^/img/p/([0-9_ns]+).jpg$" => "/babel_portrait.php?fn=$1",
"^/sidebar.html$" => "/babel.php?m=sidebar",
"^/top/wealth.html$" => "/babel.php?m=top_wealth"
)
=====end
执行install.php前 
修改 RahabControlCore.php ,加两句.
public function vxApacheCheck() { 

+++ return true;
public function vxRewriteCheck($pearURL) { 
+++ return true;
执行安装程序,完成!	

来源: http://www.v2ex.com/topic/view/8890.html

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱