I have PHP & Ajax code that doesn't work unless the visitor is on index.html. It doesn't matter if it is http:// www or http://www How can I redirect visitors from site.com or www .site.com etc.. to index.html?
It will solve your problem. Options +FollowSymLinks <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC] RewriteRule (.*) http://www.domain.com/$1 [R=301,L] RedirectMatch permanent ^/$ http://www.domain.com/index.html </IfModule> Code (markup):
If index.htm and index.php in the same directory most of the server execute index.php not index.htm but if it is index.html it will open before index.php.
If you're on Apache, you can force index.html to be the default home page if it isn't already. Put the following in an htaccess file