咖啡館日誌
The server is temporarily unable to service your request due to the site owner reaching his/her bandwidth limit. Please try again later.

02/2007 01/2006 12/2005 11/2005 09/2005 08/2005 07/2005 06/2005 05/2005 04/2005 02/2005 12/2004 11/2004 10/2004 09/2004 08/2004 06/2004 05/2004 04/2004 03/2004 01/2004 12/2003 11/2003
ExpressionEngine 本身即具備相當好的網址改寫功能,這第二彈的改法可以將網址改的更具親和力一點...

原本在 ExpressionEngine 底下的部落格網址應該是
http://www.sharksbeer.com/index.php/xxxblog

改寫之後,卻會像這裡一樣成為:

http://www.sharksbeer.com/weblog/xxxblog

作法如下:
1.將預設的首頁檔案名稱改成您所要的名稱 (這裡以"index.php" -> “weblog",亦即小站的作法為範例說明)。
2.因此第一步就是將"index.php"改名為"weblog"。但是沒有了.php的副檔名之後,Web Server如何知道這是一個php執行檔呢?請在首頁目錄之下 (一般虛擬主機為public_html) 加入一個 .htaccess 檔案,檔案內容如下:
<Files weblog>
ForceType application/x-httpd-php
</Files>
DirectoryIndex weblog index.php index.html index.htm
3.如此一來就是告訴 Web Server,將名稱為 weblog 的檔案視為 php 的檔案,同時先找名為 weblog 的檔案作為首頁檔案。也就是說,輸入 http://www.sharksbeer.com 時,Web Server就會先找weblog的檔案作為首頁,並將此首頁視為 weblog.php 加以執行。
4.接著是到: Control Panel Home › Admin › General Configuration 畫面上的 name of your website's index file 設定更改首頁檔案名稱。因為我們剛剛已經將"index.php"改為"weblog"了,所以這兒要稍作修改。

link

Powered by Blogger