2009-11-02 135 views
0
RewriteEngine on 
RewriteCond %{REQUEST_URI} !^/index\.php 
RewriteRule ^(.*)$ index.php?q=$1 [L] 

這應該重寫任何URL到index.php?q = {url},它工作。無論如何,http://www.domain.com/只是顯示一個空白頁面。我怎樣才能重寫/ index.php? (http://www.domain.co.il/index.php dosen't顯示空白頁..)Url重寫幫助

順便說一句:此代碼的重定向,而不是重寫,爲什麼呢?

謝謝。

回答

2

你需要設置DirectoryIndex.htaccess文件:

DirectoryIndex index.php 
0
RewriteEngine on 
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule ^([^/]+)/$ index.php?q=$1 [L]