Htaccess redirect if url contains a string?
<p>I want to redirect url's who contains a string "cfg-contactform", the requested url contains sometimes mixed string like "cfg-contactform-15, 16, 22" etc... but I want to redirect all url's with string "cfg-contactform" including numbers or something others...</p>

<p>The solutions what I tried are:</p>

<p><a href="https://webmasters.stackexchange.com/questions/24336/redirect-using-htaccess-if-a-url-contains-query-string">https://webmasters.stackexchange.com/questions/24336/redirect-using-htaccess-if-a-url-contains-query-string</a></p>

<p><a href="https://stackoverflow.com/questions/3220377/htaccess-redirect-if-url-contains-a-certain-string">htaccess redirect if URL contains a certain string</a></p>

<p><a href="https://stackoverflow.com/questions/21521489/redirect-if-url-contains-specific-string-using-htaccess">redirect if url contains specific string using htaccess</a></p>

<p><a href="https://stackoverflow.com/questions/3220377/htaccess-redirect-if-url-contains-a-certain-string">htaccess redirect if URL contains a certain string</a></p>

<p>What I do wrong in my examples?</p>

<pre><code>RewriteCond %{QUERY_STRING} cfg-contactform
RewriteRule .? / [R,L]

or

RewriteCond %{QUERY_STRING} cfg-contactform [OR]
RewriteCond %{REQUEST_URI} inc
RewriteRule ^ /? [L,R=301]
</code></pre>