I have an old site that I have completely changed to .html extensions. I now am at the final stages and need to redirect the index.php to index.html The trouble is that I get a redirect loop as it continues to look at index.php as the root file. Here is what I have so far in .htaccess AddType application/x-httpd-php htm html php AddHandler application/x-httpd-php .htm .html RewriteEngine on RewriteCond %{HTTP_HOST} ^example\.co.uk [NC] RewriteRule ^(.*) http://www.example.co.uk/$1 [R=301] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.html?\ HTTP/ [NC] RewriteRule ^(.*)index.html?$ http://www.example.co.uk/$1 [R=301,L] Redirect 301 /operation.php http://www.example.co.uk/ Code (markup): Any pointers on how I can go about this? Thanks a lot in advance
Hi you can try this I have implemented this on my site and it's working fine so you can use this one RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com RewriteRule (.*) http://www.example.co.uk/$1 [R=301,L] RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.*)index\.(html?|php|asp|cfm)\ HTTP/ RewriteRule ^(.*)index\.(html?|php|asp|cfm)$ http://www.example.co.uk/$1 [R=301,L] Redirect 301 /operation.php http://www.example.co.uk/CODE] Code (markup):
Please ignore first and in the last CODE] as i am new here i was not able to post the url that's why it is there :) Code (markup):