Static Web App - How to carry over query strings on 301/302 Redirect using staticwebapp.config.json?

OOng 1 Reputation point

Hello, I'm currently using staticwebapp.config.json to do 301 redirects to internal and external sites. Is there a setting or way to carry over query strings to the redirected route?


"routes": [
"route": "/redirectme/",
"redirect": "",
"statusCode": 301
"route": "/foo",
"redirect": "/bar",
"statusCode": 301

so is going to going to
possible in this file?

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
776 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 22,766 Reputation points Microsoft Employee

    OOng-1738, I confirmed the same from our Product Group: Currently, SWA does not have a mechanism to allow query strings to be passed between redirects or to otherwise be persisted. Based on your requirement, you would need to develop client-side code to do this.

    If you wish you may submit a feature request here --- All of the feedback you share on the Uservoice will be monitored and reviewed by the Microsoft engineering teams responsible for building Azure. Users with a similar request can up-vote the post and add their comments, as well.

    Kindly be assured that your feedback has also been relayed internally to our product engineering team.
    Once again, apologies for any inconvenience with this. We appreciate your valuable feedback.

    To benefit the community find the right answers, please do mark the post which was helpful by clicking on Accept Answer’ & ‘Up-Vote’.

    1 person found this answer helpful.