RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTP_HOST} ^rank24.pl
RewriteRule ^(.*)$ http://www.rank24.pl/$1 [R=permanent,L]
ErrorDocument 404 http://www.rank24.pl

RewriteCond %{REQUEST_URI}  !^(.*)/libraries/(.*) [NC]
RewriteCond %{REQUEST_URI}  !^(.*)/layout/(.*) [NC]
RewriteRule ^([^/]*)/([^/]*)/(.*)$ index.php?module=$1&action=$2&$3 [L]