《Go Web 編程》PHP網站版:PHP-For-Go-Web

jopen 9年前發布 | 15K 次閱讀 Google Go/Golang開發 PHP-For-Go-Web

PHP-For-Go-Web 是用 php+bootstrap3 來解析《Go Web 編程》的 md 文件。構建本地或者遠程網站。媽媽再也不用擔心我的網速了。

我不生產代碼,我是代碼的搬運工!展示站點:http://go.webiji.com

安裝配置

[ Apache ]

httpd.conf配置文件中加載了mod_rewrite.so模塊
AllowOverride None 將None改為 All
把下面的內容保存為.htaccess文件放到應用入口文件的同級目錄下

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ index.php?file=$1 [QSA,PT,L]
</IfModule>

本項目在wampserver下開發并且通過測試。建議使用wampserver環境。

[ IIS ]

如果你的服務器環境支持ISAPI_Rewrite的話,可以配置httpd.ini文件,添加下面的內容:

RewriteRule (.*)$ /index\.php\?file=$1 [I]

[ Nginx ]

通過在Nginx.conf中配置轉發規則實現:

location / { // …..省略部分代碼
   if (!-e $request_filename) {
   rewrite  ^(.*)$  /index.php?file=$1  last;
   break;
    }
 }

如果你的項目安裝在二級目錄,Nginx的偽靜態方法設置如下,其中goweb是所在的目錄名稱。

location /goweb/ {
    if (!-e $request_filename){
        rewrite  ^/goweb/(.*)$  /goweb/index.php?file=$1  last;
    }
}

項目主頁:http://www.baiduhome.net/lib/view/home/1446558564638

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!