まず、htmlファイルの拡張子の判断が存在しない増加、\ベンダ\ workerman \ workerman \ WebServer.phpライン176、次のように読みを見つけます:
もし(in_array($ workerman_file_extension!、[ 'PHP'、 'HTML'])&& is_file($ workerman_file )){ $ workerman_file = "{ $ workerman_root_dir } /index.phpを" 。 $ workerman_file_extension = 'PHPの。 もし(!is_file($ workerman_file )){ $ workerman_file = "{ $ workerman_root_dir } /index.htmlが" 。 $ workerman_file_extension = 'HTML' 。 } }
この後は、単に拡張子を持つHTMLファイルに移動し、ファイルが存在しない、それが自動的にindex.phpにリダイレクトされますし、行上のindex.phpに判断
二、index.phpの変換は、出力ページの前に、次のような判断を追加します。
1 // 重定向判断 2 $ URI = $ _SERVER [ 'REQUEST_URI' ]; 3 $ EXT = strtolower(SUBSTR($ URI、-4,4 )); 4 もし(is_cli()&& $ EXT == 'HTML' ){ 5 $ _GET [ '_'] = SUBSTR($ URI、1、strlenを($ URI)-5 )。 6 }
私は、アドレスがhttp://c.com/Users_login.htmlである、すなわちアクセスのindex.phpを訪れた?_ = Users_login
第三に、$ _GET [「_」]、下線付きのセグメンテーション、負荷のクラスとは、ライン上で、決定方法によれば。例えば:
1 $ _GET [ '_'] = ISSET($ _GET [ '_'])?$ _GET [ '_']:strcode( 'Index_index' ); 2 $ STRS = strcode($ _GET [ '_']、 'DECODE' )。 3 もし(!$ STRS xdie( 'のparamエラー。')); 4 の$ D = preg_split( '/[\.\_]/'、$ STRS )。 5 もし(数($ D)<2)xdie( 'エラー:PARAM' ); 6つの $クラス = $ D [0] 'アクション'。; [1]。
そして、クラスをロードし、ライン上で実行します