This is the content of my .htaccess file:

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 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 mod_expires.c>
    ExpiresActive On
    ExpiresDefault A86400
    ExpiresByType image/png A2419200
    ExpiresByType image/jpg A2419200
    ExpiresByType image/jpeg A2419200

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]
AddHandler php5-script .php

I want index.html (which does not exist) to be redirected to my controller. index.php (which exists) should be my home page.

Now, my homepage is not working when typing http://www.domain.com/ in my browser. That URL redirects to my controller. http://www.domain.com/index.php works fine, bringing my homepage.

How do I set index.php as my index file keeping my redirection for the controller?


You could try:

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]
| improve this answer | |
  • Thanks for your answer, but it didn't work. – Gerardo Sep 1 '10 at 4:45
  • Edited to use Redirect.. soz chief. – Grizly Sep 1 '10 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.