# Redirects with parameters not working

**URL:** <https://answers.netlify.com/t/redirects-with-parameters-not-working/45045>\
**Category:** Support\
**Tags:** redirects\
**Created:** [October 2, 2021, 12:43pm UTC](https://answers.netlify.com/t/redirects-with-parameters-not-working/45045 "2021-10-02T12:43:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kathylynnward](https://avatars.discourse-cdn.com/v4/letter/k/898d66/32.png) [@kathylynnward](https://answers.netlify.com/u/kathylynnward)\
**Post date:** [October 2, 2021, 12:43pm UTC](https://answers.netlify.com/t/redirects-with-parameters-not-working/45045/1 "2021-10-02T12:43:37Z")

</div>

netlify name: barbadosbydrone

I am setting up what I believe to be fairly simple redirects, however they are not working.

The old url structure is: domain/drone-video.php?drone={id}  
The new url structure is: domain/drones/{slug}

e.g. old url: `https://barbadosbydrone.com/drone-video.php?drone=74`  
new url: `https://barbadosbydrone.com/drones/birds-eye-view/`

I have a series of rules in \_redirects of this format:  
/drone-video.php?drone=74 /drones/birds-eye-view/ 301!

When I try to access [Barbados By Drone Redirects](https://barbadosbydrone.com/drone-video.php?drone=74) I am getting the 404 error page.

The deploy log shows that all 70 redirect rules were processed.  
A test of the redirect rules in [Netlify's playground](https://play.netlify.com/redirects) always shows that all redirects are valid.  
Asset optimization is turned OFF (so Pretty URLs is disabled)

 ![netlify-settings](https://global.discourse-cdn.com/netlify/original/3X/5/5/55320357c1be2f0edbe2d6a203fa2fd9062e6c48.jpeg)

Any of the rules that contain query parameters - i.e. those with drone-video.php?drone={id} - are failing.  
The only rule that works is /index.php / 301!

I’ve been through the guide at [[Support Guide] Making redirects work for you - troubleshooting and debugging](https://answers.netlify.com/t/support-guide-making-redirects-work-for-you-troubleshooting-and-debugging/13433) but have not been able to resolve this issue.

Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![hrishikesh](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hrishikesh/32/74607_2.png) [@hrishikesh](https://answers.netlify.com/u/hrishikesh)\
**Post date:** [October 3, 2021, 3:29am UTC](https://answers.netlify.com/t/redirects-with-parameters-not-working/45045/2 "2021-10-03T03:29:27Z")

</div>

Hi @kathylynnward,

Could you try to remove the query string from one of the URLs and see if that redirects correctly? If it does, you’d have to use the following to capture query strings:

> **[Redirect options](https://docs.netlify.com/routing/redirects/redirect-options/#query-parameters)**
>
> Understand redirect rule options to customize how site paths are matched and redirected.

I actually believe that you’d have to restructure your URLs in the new website, because the rules that you have would probably not work. But, let’s try to get one thing fixed at first.

---

<div class="post-metadata">

**Author:** ![kathylynnward](https://avatars.discourse-cdn.com/v4/letter/k/898d66/32.png) [@kathylynnward](https://answers.netlify.com/u/kathylynnward)\
**Post date:** [October 4, 2021, 1:37pm UTC](https://answers.netlify.com/t/redirects-with-parameters-not-working/45045/3 "2021-10-04T13:37:15Z")

</div>

The redirect did work correctly when I removed the query string from one of the URLs.  
You put me on the right track.

My rule in \_redirects is now very simple:  
/drone-video.php /redirects/ 301!

So all old URLs containing drone-video.php now redirect to a generic redirects page.  
Since query string arguments are now automatically passed through to that generic page I end up on /redirects/?drone=74 where I use javascript to look up the correct destination URL based on the drone value and redirect accordingly.

it’s not perfect from an SEO perspective but it’s a satisfactory solution for me in this instance.

Thanks for your guidance.

---

<div class="post-metadata">

**Author:** ![hillary](https://sea1.discourse-cdn.com/netlify/user_avatar/answers.netlify.com/hillary/32/21132_2.png) [@hillary](https://answers.netlify.com/u/hillary)\
**Post date:** [October 4, 2021, 1:48pm UTC](https://answers.netlify.com/t/redirects-with-parameters-not-working/45045/4 "2021-10-04T13:48:09Z")

</div>

Thanks for coming back and sharing, @kathylynnward! Glad everything is working :netliconfetti:
