How to disable '/' redirect on all links in webapp

André garcia 0 Reputation points
2023-11-25T04:06:18.34+00:00

Hi.

I have a webapp running react and it all works fine.

Recentrly been digging hard because of SEO and noticed all links on my app are getting redirected.

In sum:

In react all links end without backslash, example:

"www.test1.com/a""www.test1.com/b""www.test1.com/b"
Works the same way on localhost.

However on azure, it adds a backslash at the end.

"www.test1.com/a/""www.test1.com/b"

I inspected it and it's actually triggering a 301 and redirecting to that type of URL. All my seo goes nuts and I need to disable that redirect.

I don't often use the CLI, just the normal azure interface, I searched routing... network rules and can't find nothing.

Thanks

EDIT:

I don't have CDN or Azure frontdoor activated.

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

1 answer

Sort by: Most helpful
  1. Claudia Dos Santos Haz (CONCENTRIX CORPORATION) 1,010 Reputation points Microsoft Vendor
    2023-11-27T10:37:23.3733333+00:00

    Hi @André garcia

    I understand the issues you are having, have you considered using Azure Static Web Apps (https://learn.microsoft.com/en-us/azure/static-web-apps/overview). See the quick start for a tutorial that will guide you through setting up a react app.

    Quick Start: Building your first static site with Azure Static Web Apps (https://learn.microsoft.com/en-us/azure/static-web-apps/getting-started?tabs=react)

    Best regards,

    0 comments No comments