索引文件在.htaccess

这是我的.htaccess文件的内容:

php_flag allow_url_fopen on DirectoryIndex index.php <ifmodule mod_deflate.c> AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript </ifmodule> <IfModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file \.(html?|txt|css|php|js)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </IfModule> <IfModule mod_expires.c> ExpiresActive On ExpiresDefault A86400 ExpiresByType image/png A2419200 ExpiresByType image/jpg A2419200 ExpiresByType image/jpeg A2419200 </IfModule> AuthName domain.com ErrorDocument 404 /404.php <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^domain.com RewriteRule ^(.*)$ http://www.domain.com.ar/$1 [R=301,L] RewriteRule index.html$ Controlador/index.php [L] </IfModule> AddHandler php5-script .php 

我想index.html(不存在)被redirect到我的控制器。 index.php(存在)应该是我的主页。

现在,在我的浏览器中inputhttp://www.domain.com/时,我的主页不工作。 该URLredirect到我的控制器。 http://www.domain.com/index.php工作正常,把我的主页。

我如何设置index.php作为我的索引文件保持我的redirect控制器?

你可以尝试:

 Options +FollowSymLinks RewriteEngine on Redirect 301 /index.html http://www.domain.com.ar/Controlador/index.php RewriteCond %{HTTP_HOST} ^domain.com [NC] RewriteRule ^(.*)$ http://www.domain.com.ar/$1 [R=301,L]