Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ index.php?action=$1 [QSA,L]
RewriteCond %{QUERY_STRING} (^|&)action\=cabinet($|&)
RewriteCond %{QUERY_STRING} (^|&)userId\=4($|&)
RewriteRule ^index\.php$ /userId/4? [L,R=301]
RewriteRule ^(.*)$ index.php?$1 [QSA,L]