Your code now redirects requests for
and requests for
If you also have a non-www to www rule in your htaccess file, a request for
is redirected twice before eventually reaching
- use the Live HTTP Headers extension for Firefox to confirm this.
This unwanted redirection chain will cause issues.
You should add the canonical protocol and hostname to the rule above and make sure that the index redirect is listed before the non-www/www redirect in the htaccess file.
You should also escape all literal periods in patterns.
If your site actually uses an index.html or index.htm file to serve content you probably can't view the content now and get an error message instead. You will need to add a preceding
to ensure that only external requests for the index file are redirected, not requests for the index file that happen as a result of the final internal rewrite to fetch the content.
Finally, why redirect only root requests? Using
will enable this redirect for all folder levels.
Example code for this appears in thousands of previous threads. Note: If there is a (.*) pattern in the index rule then it is the wrong code.