Clean URLs with IIS and ISAPI 3
RewriteEngine on
RewriteCond %{HTTP:Host} ^(?:www\.)?example\.com$
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
在settings.php配置:
Windows:
$conf['clean_url'] = 1; // 1 enables, 0 clears clean_urlApache:
// Isapi_Rewrite 3.x
if (isset($_SERVER['HTTP_X_REWRITE_URL'])) {
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
}
上一篇: 解决mySQL占用内存超大问题