О параметре mod_rewrite htaccess clean URL

Мой URL: www.example.com/index.php?fruit=banana&color=yellow&amount=2

Так должно быть:
www.example.com/banana/yellow/2 ——> успех

Так почему же это так:
www.example.com/banana/2 ——> ОШИБКА

.Htaccess:

RewriteEngine On
RewriteRule ^/(.*)/(.*)/(.*)$ ./index.php?fruit=$1&color=$2&amount=$3 [NC,L]

1

Решение

Попробуй это :

RewriteEngine On
RewriteRule ^/?([^/]+)/([^/]+)/([^/]+)/?$ ./index.php?fruit=$1&color=$2&amount=$3 [QSA,NC,L]

RewriteRule ^/?([^/]+)/([^/]+)/?$ ./index.php?fruit=$1&amount=$2 [QSA,NC,L]
0

Другие решения

Других решений пока нет …