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