Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Deekshith's avatar

Redirect URL with query parameter to another URL

i have a URL with query parameter like below,

https://www.example.com/blog?cat=20

I want to redirect above URL to

https://www.example.com/blog

htaccess code is not working Any help?

0 likes
2 replies
Deekshith's avatar

@Nakov Thank you. i tried like below,

RewriteCond %{QUERY_STRING} cat=20
    RewriteRule (.*) /blog/ [R=302,L]

Above one showing below error,

This page isn’t working www.example.com redirected you too many times.

Please or to participate in this conversation.