I would like to redirect the following URL
https://www.example.com/vmi10/? to https://www.example.com/vmi10/
This is a WordPress site. How can I do that? I really appreciate any help you can provide.
I would like to redirect the following URL
https://www.example.com/vmi10/? to https://www.example.com/vmi10/
This is a WordPress site. How can I do that? I really appreciate any help you can provide.
2
Answers
Basically you want to remove empty query string from the url we use ^$ in our
RewriteCond
Condition Pattern like this:This will redirect
https://www.example.com/vmi10/? to https://www.example.com/vmi10/
This won’t affect any url with non empty query string.
Test it here: https://htaccess.madewithlove.be?share=34570386-6b48-486b-ba84-32a222921502
You may use this redirect rule as your topmost rule in main .htaccess: