轉自我的個人博客(ps:目前試用中體驗不好勿噴。。。)
使用WP Super Cache設置緩存的時候當使用wordpress默認的固定連接是,總是顯示固定連接結構出錯,然后單個博客文章無法訪問,這里需要設置httpd的url可重寫,步驟如下:
查看.HTACCESS是否需要修改
遠程連接主機,進入wordpress目錄,修改 .htaccess文件,.htaccess是隱藏文件,默認不顯示,使用ll -a命令即可看到。.htaccess文件應該內容如下:
BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
END WordPress
修改HTTPD配置文件
WordPress中除了Default的url格式外,其他的都需要url 重新支持。默認是不支持的。VPS只能自己搞了,虛擬主機一般都默認開啟的。進入apache2/httpd/conf/httpd.conf
需要編輯httpd.conf文件。
…
AllowOverride controls what directives may be placed in .htaccess files.
It can be “All”, “None”, or any combination of the keywords:
Options FileInfo AuthConfig Limit
AllowOverride None
把AllowOverride None 改成AllowOverride All
重啟服務:service httpd restart