<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Eric&#039;s Who Know &#187; .htaccess</title> <atom:link href="http://who-know.com/tag/htaccess/feed/" rel="self" type="application/rss+xml" /><link>http://who-know.com</link> <description>C&#039;est La Vie</description> <lastBuildDate>Mon, 17 May 2010 22:21:05 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.2</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Fatal error: Maximum execution time of 30 seconds exceeded</title><link>http://who-know.com/fatal-error-maximum-execution-time-of-30-seconds-exceeded/</link> <comments>http://who-know.com/fatal-error-maximum-execution-time-of-30-seconds-exceeded/#comments</comments> <pubDate>Thu, 18 Feb 2010 22:35:55 +0000</pubDate> <dc:creator>Eric</dc:creator> <category><![CDATA[WordPress]]></category> <category><![CDATA[.htaccess]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[php.ini]]></category> <category><![CDATA[SuPHP]]></category> <category><![CDATA[wp-config]]></category><guid isPermaLink="false">http://who-know.com/fatal-error-maximum-execution-time-of-30-seconds-exceeded/</guid> <description><![CDATA[WordPress 出現 Fatal error: Maximum execution time of 30 seconds exceeded 是因為主機對程式的執行時間作了限制，解決方法如下 :
// 擇一使用即可，依不可行性排序
01. 自己的主機 or 虛擬主機且可以修改 php.ini
a. 修改 php.ini 裡 max_execution_time 的數值，重新啟動 Server
b. .htaccess 加上 php_value max_input_time 300
c. wp-config.php 加上 set_time_limit( 300 );
02. 虛擬主機 : 不可以修改 php.ini
a. .htaccess 加上 php_value max_execution_time 300
b. wp-config.php 加上 set_time_limit( 300 );
// 如果主機有安裝 suPHP
.htaccess  file 的 php_value [...]]]></description> <content:encoded><![CDATA[<p><a href="http://wordpress.org/" target="_blank">WordPress</a> 出現 Fatal error: Maximum execution time of 30 seconds exceeded 是因為主機對程式的執行時間作了限制，解決方法如下 :</p><p>// 擇一使用即可，依不可行性排序</p><p>01. 自己的主機 or 虛擬主機且可以修改 php.ini</p><p>a. 修改 php.ini 裡 max_execution_time 的數值，重新啟動 Server<br /> b. .htaccess 加上 php_value max_input_time 300<br /> c. wp-config.php 加上 set_time_limit( 300 );</p><p>02. 虛擬主機 : 不可以修改 php.ini</p><p>a. .htaccess 加上 php_value max_execution_time 300<br /> b. wp-config.php 加上 set_time_limit( 300 );</p><p>// 如果主機有安裝 <a href="http://www.suphp.org/" target="_blank">suPHP</a><br /> <span style="color: #ff0080">.htaccess  file 的 php_value max_execution_time 300 改成 max_execution_time = 300</span></p><p>Ref :<br /> 01. <a href="http://www.php.net/manual/en/info.configuration.php" target="_blank">PHP Runtime Configuration</a><br /> 02. <a href="http://php.net/manual/en/function.set-time-limit.php" target="_blank">PHP set_time_limit ( int $seconds )</a></p> ]]></content:encoded> <wfw:commentRss>http://who-know.com/fatal-error-maximum-execution-time-of-30-seconds-exceeded/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>修改 WordPress Login、Logout、Register、wp-admin 位置</title><link>http://who-know.com/how-to-hide-wp-admin-folder-name-on-wordpress/</link> <comments>http://who-know.com/how-to-hide-wp-admin-folder-name-on-wordpress/#comments</comments> <pubDate>Thu, 04 Feb 2010 19:20:39 +0000</pubDate> <dc:creator>Eric</dc:creator> <category><![CDATA[Free Teaching]]></category> <category><![CDATA[.htaccess]]></category> <category><![CDATA[mod_rewrite]]></category> <category><![CDATA[Stealth Login]]></category> <category><![CDATA[WordPress]]></category><guid isPermaLink="false">http://who-know.com/?p=97</guid> <description><![CDATA[00. 修改 WordPress 後台地址 http://your.domain.name/wp-admin/ to http://your.domain.name/whatever-you-want/
01. 下載 Stealth Login 並解壓上傳到 ./wp-content/plugins/ 下。
// 或從 WordPress 後台直接搜尋 Stealth Login 下載
02. Plugins -> Installed -> Activate Stealth Login
03. WordPress 後台 -> Settings -> Stealth Login
04. 把 Enable Plugin 切換到 On，然後依據您的需要來設定您想要的網址形式，含 WordPress 登入、登出、註冊、後台的位置。
eg :
Login Slug : in -> http://who-know.com/in/；Logout Slug : out -> http://who-know.com/out/；Register Slug : reg -> [...]]]></description> <content:encoded><![CDATA[<p>00. 修改 <a href="http://wordpress.org/" target="_blank">WordPress</a> 後台地址 http://your.domain.name/wp-admin/ to http://your.domain.name/whatever-you-want/</p><p>01. 下載 <a href="http://wordpress.org/extend/plugins/stealth-login/" target="_blank">Stealth Login</a> 並解壓上傳到 ./wp-content/plugins/ 下。<br /> // 或從 <a href="http://wordpress.org/" target="_blank">WordPress</a> 後台直接搜尋 <a href="http://wordpress.org/extend/plugins/stealth-login/" target="_blank">Stealth Login</a> 下載</p><p>02. Plugins -> Installed -> Activate <a href="http://wordpress.org/extend/plugins/stealth-login/" target="_blank">Stealth Login</a></p><p>03. <a href="http://wordpress.org/" target="_blank">WordPress</a> 後台 -> Settings -> <a href="http://wordpress.org/extend/plugins/stealth-login/" target="_blank">Stealth Login</a><span id="more-97"></span></p><p>04. 把 Enable Plugin 切換到 On，然後依據您的需要來設定您想要的網址形式，含 <a href="http://wordpress.org/" target="_blank">WordPress</a> 登入、登出、註冊、後台的位置。</p><p>eg :<br /> Login Slug : in -> http://who-know.com/in/；Logout Slug : out -> http://who-know.com/out/；Register Slug : reg -> http://who-know.com/reg/；Admin Slug : admin -> http://who-know.com/admin/</p><p>05. 把 Stealth Mode 切換到 Enable，不然就變成 http://who-know.com/reg/ = http://who-know.com/wp-login.php?action=register 兩種網址形式都可以用來註冊帳號，這樣就沒有達到保護 <a href="http://wordpress.org/" target="_blank">WordPress</a> 的用意了，我們希望的是透過修改 <a href="http://wordpress.org/" target="_blank">WordPress</a> 登入、登出、註冊、後台的網址，來保護我們用心經營的聖地。</p><p>06. 最後它會生成一大串的語法加到 .htaccess file，接下來請立刻測試有沒有成功，如果您的 <a href="http://wordpress.org/" target="_blank">WordPress</a> 是安裝在子目錄的且有使用 Permalink( 中譯 : 永久連結、固定網址、偽靜態等 )，可能會有問題。</p><p>eg : 假設您的 <a href="http://wordpress.org/" target="_blank">WordPress</a> 原本是裝在 ./wordpress/ 下，您會發現剛才改的網址變成 http://your.domain.name/wordpress/wordpress/ ...，所以請下載 .htaccess file 把 RewriteBase /wordpress/ 修正一下再上傳覆蓋，即可解決問題了。<br /> // 把 RewriteBase /wordpress/ 改成 RewriteBase /</p><pre class="brush: bash;">
# BEGIN WordPress
&lt;IfModule mod_rewrite.c&gt;
RewriteEngine On
RewriteBase /wordpress/
# STEALTH-LOGIN
...
# END STEALTH-LOGIN
...
&lt;/IfModule&gt;

# END WordPress
</pre><p>07. 附註<br /> a. 設定好後，把 ./wp-content/plugins/ 下的 stealth-login 刪除，好像也可以正常運作。<br /> b. 無聊也可以定期幫它換一下 stealth_folderName_key<br /> // <a href="http://wordpress.org/" target="_blank">WordPress</a> 後台 -> Settings -> <a href="http://wordpress.org/extend/plugins/stealth-login/" target="_blank">Stealth Login</a> -> Save Changes</p><p>Ref : // 紀錄一下其它方法，其中第二個方法很原始也很暴力<br /> 01. <a href="http://www.michiknows.com/2007/02/12/who-else-wants-to-hide-their-wordpress-admin-folder/" target="_blank">Who Else Wants to Hide Their Wordpress Folder?</a><br /> 02. <a href="http://www.socialblogr.com/2009/09/how-to-change-folder-name-on-wordpress.html>" target="_blank">How To Change "wp-admin" Folder Name on Wordpress</a></p> ]]></content:encoded> <wfw:commentRss>http://who-know.com/how-to-hide-wp-admin-folder-name-on-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>WordPress Warning: Cannot modify header information &#8211; headers already sent by</title><link>http://who-know.com/wordpress-warning-cannot-modify-header-information-headers-already-sent-by/</link> <comments>http://who-know.com/wordpress-warning-cannot-modify-header-information-headers-already-sent-by/#comments</comments> <pubDate>Fri, 09 Oct 2009 08:41:45 +0000</pubDate> <dc:creator>Eric</dc:creator> <category><![CDATA[Free Teaching]]></category> <category><![CDATA[.htaccess]]></category> <category><![CDATA[php.ini]]></category> <category><![CDATA[SuPHP]]></category> <category><![CDATA[UTF-8]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[wp-config]]></category><guid isPermaLink="false">http://who-know.com/?p=88</guid> <description><![CDATA[01. 如果要存檔成 UTF-8, 千萬別跟自己過不去, 去使用 Windows 內建的記事本, 請使用 PSPad, NotePad++, EmEditor, UltraEdit 或其它好一點的文字編輯器。因為使用 Windows 內建的記事本, 以UTF-8存檔時, 會自動添加 BOM 標籤, 而造成一些問題, 如 Warning: Cannot modify header information - headers already sent by...。02. 以下由易達成性來做排序
&#160;&#160;a. 使用 PSPad, NotePad++, EmEditor, UltraEdit 或其它的好一點的文字編輯器, 來另存成 UTF-8 且選擇不要添加 BOM 標籤。
&#160;&#160;&#160;&#160;PSPad : 格式 -> UTF-8 -> 存檔
&#160;&#160;&#160;&#160;UltraEdit : 檔案 -> 另存新檔 -> 格式選 [...]]]></description> <content:encoded><![CDATA[<p>01. 如果要存檔成 UTF-8, 千萬別跟自己過不去, 去使用 <a href="http://www.microsoft.com/" target="_blank">Windows</a> 內建的記事本, 請使用 <a href="http://www.pspad.com/" target="_blank">PSPad</a>, <a href="http://notepad-plus.sourceforge.net/" target="_blank">NotePad++</a>, <a href="http://www.emeditor.com/" target="_blank">EmEditor</a>, <a href="http://www.ultraedit.com/" target="_blank">UltraEdit</a> 或其它好一點的文字編輯器。因為使用 <a href="http://www.microsoft.com/" target="_blank">Windows</a> 內建的記事本, 以UTF-8存檔時, 會自動添加 BOM 標籤, 而造成一些問題, 如 Warning: Cannot modify header information - headers already sent by...。</p><p><a href="http://pic.who-know.com/Single/PSPad_UTF-8_BOM_Label.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Single/PSPad_UTF-8_BOM_Label.png" alt="" width="500" height="120" /></a></p><p><span id="more-88"></span><br /> 02. 以下由易達成性來做排序</p><p>&nbsp;&nbsp;a. 使用 <a href="http://www.pspad.com/" target="_blank">PSPad</a>, <a href="http://notepad-plus.sourceforge.net/" target="_blank">NotePad++</a>, <a href="http://www.emeditor.com/" target="_blank">EmEditor</a>, <a href="http://www.ultraedit.com/" target="_blank">UltraEdit</a> 或其它的好一點的文字編輯器, 來另存成 UTF-8 且選擇不要添加 BOM 標籤。</p><p>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.pspad.com/" target="_blank">PSPad</a> : 格式 -> UTF-8 -> 存檔<br /> &nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.ultraedit.com/" target="_blank">UltraEdit</a> : 檔案 -> 另存新檔 -> 格式選 UTF-8 無 BOM<br /> &nbsp;&nbsp;&nbsp;&nbsp;<a href="http://notepad-plus.sourceforge.net/" target="_blank">NotePad++</a> : 格式 -> 編譯成 UTF-8碼 (檔首無 BOM) -> 存檔<br /> &nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.emeditor.com/" target="_blank">EmEditor</a> : 檔案 -> 另存新檔 -> 編碼選 UTF-8, 下方的加入一個 Unicode 籤名 (BOM) 不要打勾</p><p>&nbsp;&nbsp;b. 檢查 <a href="http://codex.wordpress.org/Editing_wp-config.php" target="_blank">wp-config.php</a> 的 &lt;?php 前, 和 ?&gt; 後是否有多於的空白或空行。</p><p>&nbsp;&nbsp;c. 使用 <a href="http://www.microsoft.com/" target="_blank">Windows</a> 內建的記事本打開 <a href="http://codex.wordpress.org/Editing_wp-config.php" target="_blank">wp-config.php</a>, 然後直接另存新檔, 編碼請選擇 ANSI。</p><p>&nbsp;&nbsp;d. 到 <a href="http://wordpress.org/latest.zip" target="_blank">WordPress.zip</a> 或 <a href="http://wordpress.org/latest.tar.gz" target="_blank">WordPress.tar.gz</a> 下載最新版本的 <a href="http://wordpress.org/" target="_blank">WordPress</a>, 解壓出 wp-config-sample.php, 改檔名成 <a href="http://codex.wordpress.org/Editing_wp-config.php" target="_blank">wp-config.php</a>, 再依您實際狀況, 來修改 <a href="http://codex.wordpress.org/Editing_wp-config.php" target="_blank">wp-config.php</a> 裡面的設定。</p><p>&nbsp;&nbsp;e. 於 php.ini 添加或修改</p><pre class="brush: php;">output_buffering = On</pre><p>或</p><pre class="brush: php;">output_buffering = 4096</pre><p>// 如果您使用的是虛擬主機, 且可以修改 php.ini, 那就在 php.ini 添加上面兩句其中一句; 如果主機是自己的, 那就打開 php.ini, 把 output_buffering 設定成 On 或 4096。</p><blockquote><p> ; Output buffering allows you to send header lines (including cookies) even<br /> ; after you send body content, at the price of slowing PHP's output layer a<br /> ; bit.  You can enable output buffering during runtime by calling the output<br /> ; buffering functions.  You can also enable output buffering for all files by<br /> ; setting this directive to On.  If you wish to limit the size of the buffer<br /> ; to a certain size - you can use a maximum number of bytes instead of 'On', as<br /> ; a value for this directive (e.g., output_buffering=4096).<br /> output_buffering = Off</p></blockquote><p>03. 為什麼這個問題大部分發生在大陸用戶呢? 分別看了 <a href="http://cn.wordpress.org/" target="_blank">CN</a> 和 <a href="http://wptw.org/" target="_blank">TW</a>, 就不難發現</p><p>a. <a href="http://cn.wordpress.org/" target="_blank">CN</a> 的做法是: WordPress en + zh_CN.mo, zh_CN.po, 翻譯過的 wp-config-sample.php, readme.html, setup-config.php 的整合包<br /> b. <a href="http://wptw.org/" target="_blank">TW</a> 的做法是: WordPress en + zh_TW.mo, zh_TW.po 語言包</p><p>如果您用好一點的文字編輯器, 或者是讓安裝程式自動由 wp-config-sample.php 產生 <a href="http://codex.wordpress.org/Editing_wp-config.php" target="_blank">wp-config.php</a>, 那您可能不會遇到這個問題, 還會感覺 <a href="http://cn.wordpress.org/" target="_blank">CN</a> 真貼心, 連安裝過程都翻譯成您熟悉的語言了。</p><p>04. 如果您 <a href="http://codex.wordpress.org/Editing_wp-config.php" target="_blank">wp-config.php</a> 都打開了, 那不妨順便添加下面 2 句</p><pre class="brush: php;">
define('WP_POST_REVISIONS', false);
define('AUTOSAVE_INTERVAL', 86400);
</pre><p>&nbsp;&nbsp;a. AUTOSAVE_INTERVAL : 用來設定自動儲存的時間間隔, 單位為 sec 秒。</p><p>&nbsp;&nbsp;b. <a href="http://codex.wordpress.org/Revision_Management" target="_blank">WP_POST_REVISIONS</a> 用來設定文章版本數 : false 那邊可以改成 -1 (同 true), 0 (同 false), >1 的整數, 如果您希望每個修改的版本都儲存下來; 那就設定成 -1 (同 true), 如果您希望關閉文章版的的功能, 那就設定成 0 (同 false); 如果您希望只要保存一固定數量, 就設定成 >1 的整數。</p><blockquote><p> true (default), -1: store every revision<br /> false, 0: do not store any revisions (except the one autosave per post)<br /> (int) > 0: store that many revisions (+1 autosave) per post. Old revisions are automatically deleted.</p></blockquote><p>如果之前的文章版本已經積的很多了, 可以利用 <a href="http://www.phpmyadmin.net/" target="_blank">phpMyAdmin</a> 來刪除, 不過記得先備份資料庫喔。<br /> // 也可以用 <a href="http://www.phpmyadmin.net/" target="_blank">Delete-Revision</a> 這個插件來做刪除。</p><pre class="brush: php;">DELETE FROM wp_posts WHERE post_type = &quot;revision&quot;;</pre><p>// 沒有說一定要用 <a href="http://www.phpmyadmin.net/" target="_blank">phpMyAdmin</a> 才能刪除, 而是一般虛擬主機大多提供的是 <a href="http://www.phpmyadmin.net/" target="_blank">phpMyAdmin</a> 所以 ..., 如果要用 MySQL command-line 或其它的工具也是可以的喔。</p><p>&nbsp;&nbsp;c. 另外, 如果出現 Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate xxx bytes) in ... 則可以加上下面那句, 如果 64M 還是不夠就把數字再改大一點。但是如果您的主機商有限制 Memory limit 上限, 那就只能停用一些較沒再使用的外掛。</p><pre class="brush: php;">define('WP_MEMORY_LIMIT', '64M');</pre><p>// 有些人會去改 ./wp-settings.php, 但每升級一次就要改一次, 所以改 <a href="http://codex.wordpress.org/Editing_wp-config.php" target="_blank">wp-config.php</a> 會比較好。</p><pre class="brush: php;">if ( !defined('WP_MEMORY_LIMIT') )
  define('WP_MEMORY_LIMIT', '32M');</pre><p>// 另外, 修改 php.ini 也是一個辦法</p><pre class="brush: php;">memory_limit = 16M</pre><p>// 最後, 修改 .htaccess file 也可行, 加上</p><pre class="brush: php;">php_value memory_limit 96M</pre><p>// 如果您的虛擬主機有安裝 <a href="http://who-know.com/enable-gzip-compression-with-suphp-installed/" target="_blank">SuPHP</a>, 則 .htaccess file 請改成</p><pre class="brush: php;">memory_limit = 96M</pre><p>Ref:<br /> 01. <a href="http://www.unicode.org/faq/utf_bom.html" target="_blank">UTF-8, UTF-16, UTF-32 &#038; BOM</a></p> ]]></content:encoded> <wfw:commentRss>http://who-know.com/wordpress-warning-cannot-modify-header-information-headers-already-sent-by/feed/</wfw:commentRss> <slash:comments>8</slash:comments> </item> <item><title>我的網址由我做主 non-www or www</title><link>http://who-know.com/301-redirect-from-non-www-to-www-by-htaccess/</link> <comments>http://who-know.com/301-redirect-from-non-www-to-www-by-htaccess/#comments</comments> <pubDate>Wed, 07 Oct 2009 19:21:08 +0000</pubDate> <dc:creator>Eric</dc:creator> <category><![CDATA[Free Teaching]]></category> <category><![CDATA[.htaccess]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[mod_rewrite]]></category><guid isPermaLink="false">http://who-know.com/?p=87</guid> <description><![CDATA[00. 如果您想一統天下, 讓 non-www url 在網址前面都加上 www 或您想把 www url 的 www 都去掉。因為搜尋引擎會視 non-www 和 www 為兩個不同的網站, 為了 SEO 著想, 或者是想讓搜尋引擎, 固定都收錄 non-www or www 的網址, 而不會三心二意, 一下收錄 non-www 一下收錄 www。01. Redirect Non-WWW to WWW
//  eg: Redirect who-know.com to www.who-know.com, 於 .htaccess file 加上# 301 Redirect Non-WWW to WWW
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(who-know\.com)(:80)? [NC]
RewriteRule ^(.*) [...]]]></description> <content:encoded><![CDATA[<p>00. 如果您想一統天下, 讓 non-www url 在網址前面都加上 www 或您想把 www url 的 www 都去掉。因為搜尋引擎會視 non-www 和 www 為兩個不同的網站, 為了 SEO 著想, 或者是想讓搜尋引擎, 固定都收錄 non-www or www 的網址, 而不會三心二意, 一下收錄 non-www 一下收錄 www。<br /> <span id="more-87"></span><br /> 01. Redirect Non-WWW to WWW<br /> //  eg: Redirect who-know.com to www.who-know.com, 於 .htaccess file 加上</p><pre class="brush: bash;">
# 301 Redirect Non-WWW to WWW
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(who-know\.com)(:80)? [NC]
RewriteRule ^(.*) http://www.who-know.com/$1 [R=301,L]
</pre><p>02. Redirect WWW to Non-WWW<br /> //  eg: Redirect www.who-know.com to who-know.com, 於 .htaccess file 加上</p><pre class="brush: bash;">
# 301 Redirect WWW to Non-WWW
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.who-know\.com)(:80)? [NC]
RewriteRule ^(.*) http://who-know.com/$1 [R=301,L]
</pre><p>03. 如果覺得自己改有點麻煩, 可以利用線上製作 .htaccess file ( <a href="http://www.htaccesseditor.com/tc.shtml" target="_blank">繁</a> <a href="http://htaccesseditor.com/sc.shtml" target="_blank">簡</a> <a href="http://htaccesseditor.com/en.shtml" target="_blank">英</a> <a href="http://htaccesseditor.com/" target="_blank">日</a> ) 來產生, 點左邊的設置WWW(w) -> 然後填上您希望統一的網址 -> 複製貼上到您的 .htaccess file<br /> //  參考上面舉的例子, 複製須要的部分即可, 用不到的就不用管它。</p><pre class="brush: bash;">
&lt;Files ~ &quot;^.(htaccess|htpasswd)$&quot;&gt;
deny from all
&lt;/Files&gt;
order deny,allow
</pre><p>04. 上傳完 .htaccess file, 可以利用 <a href="http://news.stepforth.com/seo-tools/http-header-checker.php" target="_blank">HTTP Server Header Checker</a>, <a href="http://www.seochat.com/seo-tools/redirect-check/" target="_blank">SEO Tools - Search Engine Friendly Redirect Checker</a> 來檢查是否設定成功。</p><p><a href="http://pic.who-know.com/Single/Search_Engine_Friendly_Redirect_Checker_001.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Single/Search_Engine_Friendly_Redirect_Checker_001.png" alt=""/></a></p><p><a href="http://pic.who-know.com/Single/HTTP_Server_Header_Checker_001.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Single/HTTP_Server_Header_Checker_001.png" alt=""/></a></p><p>05. 關於上面 Rewrite Rule 所用到的 NC, $1, R, L 的解釋</p><p>&nbsp;&nbsp;a. [NC] (no case) Case-insensitive, ignoring difference between 'A-Z' and 'a-z' when Pattern is matched against the current URL.</p><p>&nbsp;&nbsp;b. $1 is magically replaced with the text which was captured previously. ( $ stuff means plug in whatever follows )</p><p>&nbsp;&nbsp;c. L - Last Rule. No more rules will be proccessed if this one was successful.</p><p>&nbsp;&nbsp;d. R[=code] - Redirect. The user's web browser will be visibly redirected to the substituted URL. If you use this flag, you must prefix the substitution with http://www.somesite.com/, thus making it into a true URL. If no code is given, then a HTTP reponse of 302 (temporarily moved) is sent.</p><p>06. 另外, 大家常說的 301、302, 實際上是 301、307?</p><p>&nbsp;&nbsp;a. <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2" target="_blank">301 Moved Permanently</a></p><blockquote><p>The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible. This response is cacheable unless indicated otherwise.</p><p>The new permanent URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).</p><p>If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.</p></blockquote><p>&nbsp;&nbsp;b. <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.3" target="_blank">302 Found</a></p><blockquote><p>The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.</p><p>The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).</p><p>If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.</p></blockquote><p>&nbsp;&nbsp;c. <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.8" target="_blank">307 Temporary Redirect</a></p><blockquote><p>The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.</p><p>The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s) , since many pre-HTTP/1.1 user agents do not understand the 307 status. Therefore, the note SHOULD contain the information necessary for a user to repeat the original request on the new URI.</p><p>If the 307 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.</p></blockquote><p>08. 由於實在太好奇 302 v.s. 307, 於是又 <a href="http://www.google.com/" target="_blank">Google</a> 了一下, 終於發現原因了, 原來一個是 <a href="http://www.w3.org/Protocols/HTTP/1.0/spec.html" target="_blank">HTTP/1.0 Hypertext Transfer Protocol</a> (下面), 一個是 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616.html" target="_blank">HTTP/1.1 Hypertext Transfer Protocol</a> (上面)。</p><p>&nbsp;&nbsp;a. <a href="http://www.w3.org/Protocols/HTTP/1.0/spec.html#Code301" target="_blank">301 Moved Permanently</a></p><blockquote><p>The requested resource has been assigned a new permanent URL and any future references to this resource should be done using that URL. Clients with link editing capabilities should automatically relink references to the Request-URI to the new reference returned by the server, where possible.<br /> The new URL must be given by the Location field in the response. Unless it was a HEAD request, the Entity-Body of the response should contain a short note with a hyperlink to the new URL.</p><p>If the 301 status code is received in response to a request using the POST method, the user agent must not automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.</p></blockquote><p>&nbsp;&nbsp;b. <a href="http://www.w3.org/Protocols/HTTP/1.0/spec.html#Code301" target="_blank">302 Moved Temporarily</a></p><blockquote><p>The requested resource resides temporarily under a different URL. Since the redirection may be altered on occasion, the client should continue to use the Request-URI for future requests.<br /> The URL must be given by the Location field in the response. Unless it was a HEAD request, the Entity-Body of the response should contain a short note with a hyperlink to the new URI(s).</p><p>If the 302 status code is received in response to a request using the POST method, the user agent must not automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.</p></blockquote><p>Ref:  //  其實只有參考第一個, 複製了它的解釋, 其它篇是覺得寫得不錯, 值得收藏一下^^<br /> 01. <a href="http://www.workingwith.me.uk/articles/scripting/mod_rewrite" target="_blank">mod_rewrite, a beginner's guide (with examples)</a><br /> 02. <a href="http://www.ragepank.com/tags/301-redirect/" target="_blank">301-redirect</a><br /> 03. <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" target="_blank">Apache mod_rewrite</a><br /> 04. <a href="http://www.timmguru.com/2006/08/seo-tips-mod-rewrite-non-www-to-www.html" target="_blank">SEO Tips - Mod Rewrite Non-WWW to WWW</a><br /> 05. <a href="http://theseoblogger.com/seo-links/seo-url-tip-www-and-non-www/" target="_blank">Using Mod-rewrite to Redirect Non-www URL to www URL</a><br /> 06. <a href="http://www.redfinsolutions.com/redfin-blog/improve-your-seo-redirecting-non-www-traffic-www" target="_blank">Improve Your SEO By Redirecting Non-WWW Traffic to WWW</a><br /> 07. <a href="http://divspace.com/seo/redirect-visitors-from-non-www-to-www-version-of-your-website-with-htaccess-mod-rewrite/" target="_blank">Redirect Visitors From Non-WWW To WWW Version Of Your Website With .htaccess And mod_rewrite</a></p> ]]></content:encoded> <wfw:commentRss>http://who-know.com/301-redirect-from-non-www-to-www-by-htaccess/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>在虛擬主機有安裝 SuPHP 情況下啟用 Gzip</title><link>http://who-know.com/enable-gzip-compression-with-suphp-installed/</link> <comments>http://who-know.com/enable-gzip-compression-with-suphp-installed/#comments</comments> <pubDate>Tue, 15 Sep 2009 14:44:16 +0000</pubDate> <dc:creator>Eric</dc:creator> <category><![CDATA[Free Teaching]]></category> <category><![CDATA[.htaccess]]></category> <category><![CDATA[Gzip]]></category> <category><![CDATA[JustHost]]></category> <category><![CDATA[mod_deflate]]></category> <category><![CDATA[SuPHP]]></category><guid isPermaLink="false">http://who-know.com/?p=77</guid> <description><![CDATA[01. 因為希望 WordPress 可以再快一點, 所以就想把 Gzip 打開, 這就是成長的動力, 好還要更好, 沒有最好只有更好, 於是創了個 phpinfo.php, 想更進一步的來了解一下自己的虛擬主機。
&#60;?php phpinfo(); ?&#62;
查看了自己的 Server 是否有支援 GZIP, 發現恰是一切正常.HTTP_ACCEPT_ENCODING  gzip, deflate
_SERVER[&#34;HTTP_ACCEPT_ENCODING&#34;] gzip, deflate
_ENV[&#34;HTTP_ACCEPT_ENCODING&#34;] gzip, deflate02. 於是分別在 .htaccess file 加上
a. 結果出現 HTTP 500 - Internal Server Error.php_flag zlib.output_compression on
php_value zlib.output_compression_level 4b. 第二種沒反應  // that is, 不支持 mod_deflate&#60;ifmodule mod_deflate.c&#62;
DeflateCompressionLevel 4
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter [...]]]></description> <content:encoded><![CDATA[<p>01. 因為希望 <a href="http://wordpress.org/" target="_blank">WordPress</a> 可以再快一點, 所以就想把 Gzip 打開, 這就是成長的動力, 好還要更好, 沒有最好只有更好, 於是創了個 phpinfo.php, 想更進一步的來了解一下自己的虛擬主機。</p><pre class="brush: php;">&lt;?php phpinfo(); ?&gt;</pre><p>查看了自己的 Server 是否有支援 GZIP, 發現恰是一切正常.</p><pre class="brush: plain;">
HTTP_ACCEPT_ENCODING  gzip, deflate
_SERVER[&quot;HTTP_ACCEPT_ENCODING&quot;] gzip, deflate
_ENV[&quot;HTTP_ACCEPT_ENCODING&quot;] gzip, deflate
</pre><p>02. 於是分別在 .htaccess file 加上</p><p>a. 結果出現 HTTP 500 - Internal Server Error.</p><pre class="brush: php;">
php_flag zlib.output_compression on
php_value zlib.output_compression_level 4
</pre><p>b. 第二種沒反應  // that is, 不支持 mod_deflate</p><pre class="brush: php;">
&lt;ifmodule mod_deflate.c&gt;
DeflateCompressionLevel 4
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE js css
&lt;/ifmodule&gt;
</pre><p>03. 兩種都沒成功, 於是又上網 Google , 找了好久才發現如果主機有裝 <a href="http://www.suphp.org/" target="_blank">SuPHP</a>, 寫法會有不同, 要稍稍修正。</p><blockquote><p> When SuPHP is enabled, it is no longer possible to to include php_value directives in .htaccess files.</p><p>Instead of adding these directives to your .htaccess file, add them into a file called <font color="#ff0080">php.in</font></span> and place this file in the same directory that your script runs in. Most often this will be public_html directory, but in some cases you will install your script in a subdirectory. Wherever your script runs, this is the place for your php.ini file. You will need to <font color="#ff0080">drop the "php_flag" and "php_value" prefix.</font> You will also need to <font color="#ff0080">put an equals (=) sign between the setting and the value.</font></p></blockquote><p>a. 前面不要加上 "php_flag" and "php_value"<br /> b. 設定和值中間用 "=" 隔開<br /> c. 原本放在 .htaccess file -> 改放置在 php.ini file</p><p>eg:原本放 .htaccess file</p><pre class="brush: php;">
php_value max_execution_time 60
php_flag zlib.output_compression on
</pre><p>改後放 php.ini  // 目錄下沒 php.ini, 就自己創, 改好後再上傳, 非 php.ini.txt 喔</p><pre class="brush: php;">
max_execution_time = 60
zlib.output_compression = on
</pre><p>所以原本在 .htaccess file 的寫法, 要改成下面的樣子, 然後放置於 php.ini</p><pre class="brush: php;">
zlib.output_compression = on
zlib.output_compression_level = 4
</pre><p>04. 最後, 別忘了來 <a href="http://www.gidnetwork.com/tools/gzip-test.php" target="_blank">Gzip Test</a> 驗收成果</p><p>ps.<br /> a. 如果啟用 Gzip 出現 HTTP 500 - Internal Server Error, 很可能就是您的虛擬主機有使用 <a href="http://www.suphp.org/" target="_blank">SuPHP</a><br /> b. <a href="http://www.justhost.com/" target="_blank">JustHost</a> 有使用 <a href="http://www.suphp.org/" target="_blank">SuPHP</a><br /> c. 沒特別設定 compression level 的話, 預設是6, 數字可以是 1~9<br /> d. Compression test : 32,380 bytes  // 超過 4 級就沒什麼差別了</p><blockquote><p> Level 1:  9,161 bytes  71.7%<br /> Level 2:  8,915 bytes  72.5%<br /> Level 3:  8,757 bytes  73.0%<br /> Level 4:  8,400 bytes  74.1%<br /> Level 5:  8,215 bytes  74.6%<br /> Level 6:  8,155 bytes  74.8%<br /> Level 7:  8,120 bytes  74.9%<br /> Level 8:  8,108 bytes  75.0%<br /> Level 9:  8,100 bytes  75.0%</p></blockquote><p>Ref:<br /> 01. <a href="http://www.hostingcustomers.com/showthread.php?tid=416" target="_blank">All servers having SuPHP installed for added security</a><br /> 02. <a href="http://www.mybelovedphp.com/2006/11/29/how-to-use-gzip-compression-on-your-php-websites/" target="_blank">How to use gzip compression on your PHP websites</a><br /> 03. <a href="http://falcon1986.wordpress.com/2009/01/29/forcing-gzip-compression-on-your-hostmonster-hosted-website/" target="_blank">Force GZIP compression on your HostMonster-hosted website</a><br /> 04. <a href="http://www.venasun.com/blog/10/gzip-files" target="_blank">GZIP files</a></p> ]]></content:encoded> <wfw:commentRss>http://who-know.com/enable-gzip-compression-with-suphp-installed/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>自動為圖片添加浮水印 WordPress Watermark Plulgin</title><link>http://who-know.com/wordpress-watermark-plulgin/</link> <comments>http://who-know.com/wordpress-watermark-plulgin/#comments</comments> <pubDate>Sun, 06 Sep 2009 00:48:15 +0000</pubDate> <dc:creator>Eric</dc:creator> <category><![CDATA[Free Teaching]]></category> <category><![CDATA[.htaccess]]></category> <category><![CDATA[Watermark]]></category> <category><![CDATA[WordPress Plulgin]]></category> <category><![CDATA[WP-WaterMark]]></category><guid isPermaLink="false">http://who-know.com/?p=76</guid> <description><![CDATA[01. WP-WaterMark 是一款名副其實 (亦作名符其實) 的 WordPress 自動添加 Watermark 浮水印的 Plugin。
a. 請到這下載 WP-WaterMark，解壓上傳至 /wp-content/plugins/ 下，並在後台啟用。
// 有兩種版本，一種是 with fonts、without fonts，如果您是要加自己的圖片 or 有自己較喜歡的字型，那下載 without fonts 即可。
b. 打開 /wp-admin/includes/media.php，用 Ctrl+F 找到 "function media_handle_upload" 或 "// Save the data"，然後在適當位置 "// Save the data" 前加入下面的 code// For WP WaterMark
MM_Execute_WM( $file, '' );c. 圖片浮水印 [...]]]></description> <content:encoded><![CDATA[<p>01. <a href="http://www.wp-watermark.com/" target="_blank">WP-WaterMark</a> 是一款名副其實 (亦作名符其實) 的 WordPress 自動添加 Watermark 浮水印的 Plugin。</p><p>a. 請到這下載 <a href="http://www.wp-watermark.com/download" target="_blank">WP-WaterMark</a>，解壓上傳至 /wp-content/plugins/ 下，並在後台啟用。<br /> // 有兩種版本，一種是 with fonts、without fonts，如果您是要加自己的圖片 or 有自己較喜歡的字型，那下載 without fonts 即可。</p><p>b. 打開 /wp-admin/includes/media.php，用 Ctrl+F 找到 "function media_handle_upload" 或 "// Save the data"，然後在適當位置 "// Save the data" 前加入下面的 code</p><pre class="brush: php;">
    // For WP WaterMark
    MM_Execute_WM( $file, '' );
</pre><p><a href="http://pic.who-know.com/Watermark/001.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Watermark/001.png" alt="" width="547" height="332"/></a></p><p>c. 圖片浮水印 : 請把 /wp-content/plugins/watermark/ 下的 stempel.png 換成您想要加的 logo。</p><p>d. 文字浮水印 : 請上傳您想用的字型到 /wp-content/plugins/watermark/fonts/ 下。</p><p>e. 請移駕玉步到 WP 後台 -> Settings -> Watermark -> 進行設定。</p><p>啟用 -> 選位置 (用Offset微調) -> 選圖片型 Watermark 浮水印 -> Save。<br /> <a href="http://pic.who-know.com/Watermark/002.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Watermark/002.png" alt="" width="539" height="301"/></a></p><p>啟用 -> 選位置 (用Offset微調) -> 選文字型 Watermark 浮水印 -> 設定字型、大小、顏色(<a href="http://who-know.com/o/color.html" target="_blank">Html Color Code</a>)、要顯示的文字、不透明度 (100:完全不透明，0:完全透明)、陰影。<br /> <a href="http://pic.who-know.com/Watermark/003.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Watermark/003.png" alt="" width="539" height="301"/></a></p><p>f. 這樣只要自 WP 後台上傳的圖片，都會自動加上 浮水印 Watermark 了。</p><p><a href="http://pic.who-know.com/Watermark/004.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Watermark/004.png" alt="" width="541" height="708"/></a><br /><HR /></p><p><span id="more-76"></span>02. 這不是一個專屬於 WordPress 的 Plugin，但這邊就先介紹怎麼把它應用於 WordPress 來自動添加 Watermark 浮水印。</p><p>a. 請到這下載 <a href="http://wpglamour.com/download/Watermark.zip" target="_blank">Watermark Script</a>，解壓，上傳至您 WordPress 所在的目錄。<br /> // That is, empty.png, watermark.png, and watermark.php 和 wp-admin, wp-content, and wp-include 是在一起的。</p><p>b. 請把下面的 code 加到您的 .htaccess file。.htaccess file 天生穿著隱形斗篷，如果想要看到它，要開啟類似 show hidden files 顯示隱藏檔案的功能。<br /> // eg: FileZilla -> Server (伺服器) -> Force showing hidden files</p><pre class="brush: php;">
RewriteRule ^(.*)wp-content/uploads/(.*) $1watermark.php?src=wp-content/uploads/$2
</pre><p>c. 照您以前的習慣繼續寫 Blog 和上傳圖片即可自動添加 Watermark 浮水印。</p><p><a href="http://pic.who-know.com/Watermark/005.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Watermark/005.png" alt="" width="530" height="525"/></a><HR /></p><p>03. <a href="http://wpglamour.com/how-to-watermark-all-your-uploaded-images/" target="_blank">GlamourGaby's Watermark Script</a> v.s. <a href="http://www.wp-watermark.com/" target="_blank">Marekkis's WordPress Watermark-Plugin</a></p><p><a href="http://pic.who-know.com/Watermark/006.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Watermark/006.png" alt="" width="512" height="336"/></a></p><p>右邊的 石井香織 Kaori ishii 比左邊的地球 Earth 漂亮，但左邊的地球 Earth 比右邊的 石井香織 Kaori ishii 更重要，那怎麼比啊 ? 不是請您看 Earth 和 Kaori ishii 啦。</p><p>如果您注意看的話會發現，用 <a href="http://wpglamour.com/how-to-watermark-all-your-uploaded-images/" target="_blank">GlamourGaby's Watermark Script</a> 弄的，看的時候有 Watermark 浮水印，但存的圖片是沒有 Watermark 浮水印的喔；但 <a href="http://www.wp-watermark.com/" target="_blank">Marekkis's WordPress Watermark-Plugin</a> 弄的，卻是表裡如一喔。<br /> 所以 <a href="http://www.wp-watermark.com/" target="_blank">Marekkis's WordPress Watermark-Plugin</a> 還能先備份圖片，然後批次加 Watermark 浮水印。</p><p>a. 請移駕玉步至 WP 後台 -> Settings -> Watermark-Dir -> 進行設定</p><p><a href="http://pic.who-know.com/Watermark/007.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Watermark/007.png" alt="" width="506" height="352"/></a></p><p><a href="http://pic.who-know.com/Watermark/008.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Watermark/008.png" alt="" width="520" height="293"/></a></p><p><a href="http://pic.who-know.com/Watermark/009.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img class="doCenter" src="http://pic.who-know.com/Watermark/009.png" alt="" width="502" height="428"/></a></p><p>Ref:<br /> 01. <a href="http://wpglamour.com/how-to-watermark-all-your-uploaded-images/" target="_blank">GlamourGaby's Watermark Script</a><br /> 02. <a href="http://www.wp-watermark.com/" target="_blank">Marekkis's WordPress Watermark-Plugin</a></p> ]]></content:encoded> <wfw:commentRss>http://who-know.com/wordpress-watermark-plulgin/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>讓 Windows Appserv 支援 .htaccess</title><link>http://who-know.com/having-the-appserv-in-windows-support-the-htaccess-file/</link> <comments>http://who-know.com/having-the-appserv-in-windows-support-the-htaccess-file/#comments</comments> <pubDate>Sat, 15 Aug 2009 16:04:51 +0000</pubDate> <dc:creator>Eric</dc:creator> <category><![CDATA[Free Teaching]]></category> <category><![CDATA[.htaccess]]></category> <category><![CDATA[Apache]]></category> <category><![CDATA[Appserv]]></category> <category><![CDATA[Permalinks]]></category> <category><![CDATA[Windows]]></category><guid isPermaLink="false">http://who-know.com/%e8%ae%93-windows-appserv-%e6%94%af%e6%8f%b4-htaccess/</guid> <description><![CDATA[0. 為了測試 cos_slug_translator 這之 WP Plugin 的能力，所以想讓我架在本機 Windows 的 WP 也能支持 Permalinks，所以就研究一下怎樣讓 Windows 下的 AppServ 也支援 .htaccess
1. 找到你安裝 Apache 的資料夾，並進到 conf 資料夾 (default:C:\AppServ\Apache2.2\conf)2. 用 文字編輯器 (eg:NotePad, NotePad++, Emeditor, UltraEditor ... etc ) 打開 httpd.conf
3.
a. 法一
Ctrl + F 找到 #LoadModule rewrite_module modules/mod_rewrite.so 把前面的 # 去掉
b. 法二
[...]]]></description> <content:encoded><![CDATA[<p>0. 為了測試 cos_slug_translator 這之 WP Plugin 的能力，所以想讓我架在本機 Windows 的 WP 也能支持 Permalinks，所以就研究一下怎樣讓 Windows 下的 AppServ 也支援 .htaccess</p><p>1. 找到你安裝 Apache 的資料夾，並進到 conf 資料夾 (default:C:\AppServ\Apache2.2\conf)</p><p><a href="http://pic.who-know.com/Having_the_AppServ_in_Windows_Support_the_htaccess_File/001.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img src="http://pic.who-know.com/Having_the_AppServ_in_Windows_Support_the_htaccess_File/001.png" alt="" width="554" height="321" /></a></p><p>2. 用 文字編輯器 (eg:NotePad, NotePad++, Emeditor, UltraEditor ... etc ) 打開 httpd.conf</p><p>3.<br /> a. 法一<br /> Ctrl + F 找到 #LoadModule rewrite_module modules/mod_rewrite.so 把前面的 # 去掉<br /> b. 法二<br /> Ctrl + H 取代 目標 #LoadModule rewrite_module modules/mod_rewrite.so<br /> 取代    LoadModule rewrite_module modules/mod_rewrite.so</p><p><a href="http://pic.who-know.com/Having_the_AppServ_in_Windows_Support_the_htaccess_File/002.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img src="http://pic.who-know.com/Having_the_AppServ_in_Windows_Support_the_htaccess_File/002.png" alt="" width="524" height="357" /></a></p><p>4. 用上面的方法把 #AccessFileName .htaccess 前面的 # 去掉 ( 有的default就去掉了 )</p><p>5. Restart Apache Server, Done! // 我按Restart沒有用，按 Stop 再按 Start 才成功<br /> <a href="http://pic.who-know.com/Having_the_AppServ_in_Windows_Support_the_htaccess_File/003.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img src="http://pic.who-know.com/Having_the_AppServ_in_Windows_Support_the_htaccess_File/003.png" alt="" width="554" height="321" /></a></p><p><a href="http://pic.who-know.com/Having_the_AppServ_in_Windows_Support_the_htaccess_File/004.png" class="highslide-image" onclick="return hs.expand(this);" target="_blank"><img src="http://pic.who-know.com/Having_the_AppServ_in_Windows_Support_the_htaccess_File/004.png" alt="" width="554" height="470" /></a></p> ]]></content:encoded> <wfw:commentRss>http://who-know.com/having-the-appserv-in-windows-support-the-htaccess-file/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>