Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I have a WordPress site and need to redirect some URLs based on a query string.
The link is /?product_brand=brandname
/?product_brand=brandname
I need to redirect them all to /?product_bisbrand=brandname
/?product_bisbrand=brandname
Can someone point me in the right direction, please?
Try putting this somewhere appropriate in the htaccess file in your document root:
RewriteEngine On RewriteCond %{QUERY_STRING} (.*)product_brand=([^&]+)&?(.*) RewriteRule ^(.*)$ /$1?%1product_bisbrand=%2&%3 [R=301,L]
Add a comment
Required, but never shown
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.
Explore related questions
See similar questions with these tags.