2

for some reason our CMS had added after every article ?language=en. We had it fixed but now I need to 301 redirect all links to /subcategory/%artical% without the ?language=en.

I want to redirect:

/subcategory/%artical%?language=en

to:

/subcategory/%artical%

I tried this RewriteRule:

RewriteRule ^www/%1?language=ru ^/www/%1 [R=301,NC,L]

but it did not work.

1 Answer 1

1

You can try this

RewriteCond %{QUERY_STRING}     ^language=en    [NC]
RewriteRule .*       /$0        [NC,L,R=301]

In first line it check that query string contains language=en and then redirect to same url, but without query string

Sign up to request clarification or add additional context in comments.

Comments

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.