-1

kitten :) How to make at the same time a redirect from /index.html, /index.php and / index to root?

I tried this code

RewriteCond %{THE_REQUEST} ^.*/index\.php 
RewriteRule ^(.*)index.php$ /$1 [R=301,L] 
RewriteCond %{THE_REQUEST} ^.*/index\.html 
RewriteRule ^(.*)index.html$ /$1 [R=301,L] 
RewriteCond %{THE_REQUEST} ^.*/index 
RewriteRule ^(.*)index$ /$1 [R=301,L] 

but with this code administrative panel MODX ceases to work normally

1 Answers1

0

You can simply use a Redirect

Redirect /index /

This will redirect /index/anyPath to root.

Amit Verma
  • 40,709
  • 21
  • 93
  • 115