2009-11-02 104 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]