Im using mod_rewrite to direct all non-www requests to the www. url using the following code
RewriteEngine On
Options +FollowSymLinks
# non-www to www resolve
RewriteCond %{HTTP_HOST} !^www\.website\.co\.uk$ [NC]
RewriteRule ^(.*)$ http://www.website.co.uk/$1 [R=301,L]
however i recently changed the index page from .html to .php and have several external links still pointing to the index.html page.
simply adding a 301 redirect results in a loop due to the above rule
#1 Permanent URL redirect
Redirect 301 /index.html http://www.website.co.uk/
How can i adapt this code to maintain a non-www redirect and also redirect index.html requests to index.php or www.website.co.uk/