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/?
Asked
Active
Viewed 28 times
2
-
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 Answers
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