Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

ErrorDocument 404 /404.php
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^
RewriteRule ^(.*)$$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 in my browser. That URL redirects to my controller. works fine, bringing my homepage.

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

share|improve this question

You could try:

Options +FollowSymLinks 
RewriteEngine on 
Redirect 301 /index.html
RewriteCond %{HTTP_HOST} ^ [NC]
RewriteRule ^(.*)$$1 [R=301,L]
share|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 posting your answer, you agree to the privacy policy and terms of service.

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