RewriteEngine on RewriteRule ^/([^/]+)/index.php http://www.itoil.ru/$1/index.php [R] 
  • one
    @ Artamonov_Pavel, specify what you wanted to achieve? Redirect from /index.php to the version without index.php ? - VenZell

2 answers 2

It is necessary to remove the slash immediately after the first character ^

 RewriteEngine on RewriteRule ^([^/]+)/index.php http://www.itoil.ru/$1/index.php [R] 

    Perhaps you forgot to remove 'index.php' in the replacement line.

     RewriteRule ([^/]+)/index.php$ /$1/ [R,QSA,L] 
    • Writes a cyclic redirection. Options + FollowSymLinks ErrorDocument 401 / en / errors / 401 / ErrorDocument 403 / en / errors / 403 / ErrorDocument 404 / en / errors / 404 / ErrorDocument 500 / en / errors / 500 / RewriteEngine on RewriteBase / RewriteCond% {HTTP_HOST} ^ www .it-oil.ru RewriteRule ^ (. *) $ itoil.ru/$1 [R = 301, L] RewriteCond% {HTTP_HOST} ^ [^ www \.] RewriteRule ^ (. *) $ % {HTTP_HOST} / $ 1 [R = 301, L] #RewriteCond% {REQUEST_URI} ^ /?. * / Index.php $ #RewriteRule ^ /? (. *) / Index.php $ itoil.ru/$1 [R = 301, L] - Artamonov_Pavel
    • #News rewrite rule RewriteCond% {REQUEST_FILENAME}! -F RewriteCond% {REQUEST_FILENAME! +) $ [OR] RewriteCond% {REQUEST_URI} ^ / news /([\\\.+)$ RewriteRule ^ (. *) / (. *) $ News / index.php? Id = $ 2 &% {QUERY_STRING} [L] #Main rewrite rule RewriteCond% {REQUEST_FILENAME}! -F RewriteCond% {REQUEST_URI}! ^ / En / RewriteRule ^ (. *) $% {DOCUMENT_ROOT} ru / $ 1?% {QUERY_STRING} [L] - Artamonov_Pavel