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]
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top