Options +FollowSymLinks RewriteEngine on RewriteBase / RewriteRule ^p(\d+)[-/].*[-/]l(\d+)-.*$ index\.php?id=$1-$2&%{QUERY_STRING} [L] RewriteRule ^p(\d+)[-/]l(\d+)[-/].*$ index\.php?id=$1-$2&%{QUERY_STRING} [L] RewriteRule ^l(\d+)[-/].*[-/]p(\d+)[-/].*$ index\.php?id=$2-$1&%{QUERY_STRING} [L] RewriteRule ^l(\d+)[-/]p(\d+)[-/].*$ index\.php?id=$2-$1&%{QUERY_STRING} [L] RewriteRule ^.*[-/]l(\d+)[-/]p(\d+)[-/].*$ index\.php?id=$2-$1&%{QUERY_STRING} [L] RewriteRule ^.*[-/]l(\d+)[-/].*[-/]p(\d+)[-/].*$ index\.php?id=$2-$1&%{QUERY_STRING} [L] RewriteRule ^.*[-/]p(\d+)[-/].*[-/]l(\d+)[-/].*$ index\.php?id=$1-$2&%{QUERY_STRING} [L] RewriteRule ^.*[-/]p(\d+)[-/]l(\d+)[-/].*$ index\.php?id=$1-$2&%{QUERY_STRING} [L]