2

What rule should I write in the .htaccess file for the redirect to work from http://site.ru/index.php/ru - to http://site.ru/ru/?

  • Possible duplicate of [htaccess remove index.php from url](https://stackoverflow.com/questions/4365129/htaccess-remove-index-php-from-url) – User123456 Dec 14 '17 at 09:53

2 Answers2

1

This should work.

RewriteEngine On

RewriteRule ^index.php/ru http://site.ru/ru/ [R=301,L]

Brum
  • 629
  • 7
  • 27
0

Enable rewrite module in apache, then add below lines to .htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

OR

RewriteBase /
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L]
User123456
  • 2,492
  • 3
  • 30
  • 44