參考文章如下:
http://www.cnblogs.com/flymood/p/4868401.html
在ubuntu 下的設定方法為:
用指令開啟僞靜态sudo a2enmod rewrite
service apache2 restart
然後在/etc/apache2/apache2.config中設定通路的站點
1 2 3 4 5 6 7 8 9 | |
service apache2 restart
2. 配置htaccess 檔案
Apache是 Linux 主機下常見的環境,現在一般的 Linux 虛拟主機都采用這種環境。建立一個 htaccess.txt 檔案,添加下面的代碼:
-
<IfModule mod_rewrite.c>
-
RewriteEngine On
-
RewriteBase /
-
RewriteRule ^index\.php$ - [L]
-
RewriteCond %{REQUEST_FILENAME} !-f
-
RewriteCond %{REQUEST_FILENAME} !-d
-
RewriteRule . /index.php [L]
-
</IfModule>
然後上傳到 WordPress 站點的根目錄,重命名為 .htaccess 即可
(flymood: 我好像是直接自動生成的,沒有要手動添加)
3、重新開機Apache
/etc/init.d/httpd restart
4、設定WordPress
系統運維 www.osyunwei.com 溫馨提醒:qihang01原創内容©版權所有,轉載請注明出處及原文連結
在WordPress背景-設定-固定連結-自定義結構,輸入下面的代碼,最後儲存更改即可。
/archives/%post_id%.html