题
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
这么想的显示空白页。)
BTW:此代码的重定向和不重写,为什么
感谢。
解决方案
您需要设置DirectoryIndex
在.htaccess
文件:
DirectoryIndex index.php
其他提示
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ index.php?q=$1 [L]
不隶属于 StackOverflow