一.我司windows和linux主機都支持wordpress偽靜態。linux主機較簡單,安裝好程序到后臺設置》固定鏈接》直接進行設置就可支持。
強烈建議使用wordpress的客戶使用Linux虛擬主機!!linux系統規則:
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
以上規則保存上傳到網站根目錄,并重新命名 .htaccess
對于windows2003系統主機,在wordprcess的后臺>設置(Options)》固定鏈接(Permalinks)啟用
主機設置具體步驟:
1.新建一個"chineseurl.php"文件并上傳至wordpress的安裝目錄:
<?php
// IIS Mod-Rewrite
if (isset($_SERVER['HTTP_X_ORIGINAL_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL'];
}
// IIS Isapi_Rewrite
else if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
}
else
{
// Use ORIG_PATH_INFO if there is no PATH_INFO
if ( !isset($_SERVER['PATH_INFO']) && isset($_SERVER['ORIG_PATH_INFO']) )
$_SERVER['PATH_INFO'] = $_SERVER['ORIG_PATH_INFO'];
// Some IIS + PHP configurations puts the script-name in the path-info (No need to append it twice)
if ( isset($_SERVER['PATH_INFO']) ) {
if ( $_SERVER['PATH_INFO'] == $_SERVER['SCRIPT_NAME'] )
$_SERVER['REQUEST_URI'] = $_SERVER['PATH_INFO'];
else
$_SERVER['REQUEST_URI'] = $_SERVER['SCRIPT_NAME'] . $_SERVER['PATH_INFO'];
}
// Append the query string if it exists and isn't null
if (isset($_SERVER['QUERY_STRING']) && !empty($_SERVER['QUERY_STRING'])) {
$_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
}
}
require("index.php");
?>
2.在控制面板-isapi篩選器-打開自定義偽靜態支持
3.修改主機/others/discuz/目錄下的規則文件httpd.conf在[ISAPI_Rewrite]下添加:
RewriteBase /
RewriteCond %{REQUEST_URI} !^.*(.css|.js|.gif|.png|.jpg|.jpeg|.xml)
RewriteRule ^(?!index.php|wp-|xmlrpc)(.*)$ /chineseurl.php [I,L]
2008系統參考http://www.shinetop.cn/faq/list.asp?unid=625