This is how currently .htaccess looks

RewriteCond %{HTTP_HOST} ^dom\.startnet\.info$ [NC] RewriteRule ^(.*)$ http://www.dom.startnet.info/$1 [R=301,L] # RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /([^/]+/)*(index)\.(html)\ HTTP/ [NC] RewriteRule ^(([^/]+/)*)(index)\.(html)$ http://www.dom.startnet.info/$1 [L,R=301] 

Redirect from www. works correctly, with index.html does not work. Moreover, the same code, if we replace index with default and change the page address from index.html to default.html, works correctly.

Saytik samopisny.

What could be the problem?

  • Explain what a redirect should do with index.html and in what cases. Your example is not very readable. - iosp
  • from the address www.dom.startnet.info/index.html should transfer to www.dom.startnet.info - Klim

1 answer 1

Replace

 RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /([^/]+/)*(index)\.(html)\ HTTP/ [NC] RewriteRule ^(([^/]+/)*)(index)\.(html)$ http://www.dom.startnet.info/$1 [L,R=301] 

on

 RewriteRule ^index\.html$ / [R=301,L] 
  • I tried, it also does not work. Where is some conflict, but I can not understand where. - Klim
  • and if to add RewriteBase / to the beginning of .htaccess? - iosp
  • No, it does not work either. Somewhere there is probably another conflict, I will understand, thanks :) - Klim
  • Yes, obviously somewhere else. Applied this redirect to age.su - it works as it should. You have another problem. - iosp