1

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...

The solutions what I tried are:

https://webmasters.stackexchange.com/questions/24336/redirect-using-htaccess-if-a-url-contains-query-string

htaccess redirect if URL contains a certain string

redirect if url contains specific string using htaccess

htaccess redirect if URL contains a certain string

What I do wrong in my examples?

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

or

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

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.