Dynamic routes for static page

Hey guys really need help with dynamic paths. I need my path on the site https://mybestapp.com/party/{1231231233}
worked as dynamic, and one party.html page was always opened.
Just to go https://mybestapp.com/party/1
or https://mybestapp.com/party/2 etc.
the party.html page was always rendered. How can I do it?

@VictorPulzz I’m struggling to understand exactly what you’re asking.

Are you asking:

  1. How you can make every request go to /party.html?
  2. How you can prevent every request from going to /party.html?

Hello, I want every not every request to be redirected, but only mybestsite.com/party/{any number} and this routes load party.html file

Check out: Edge Functions overview | Netlify Docs

I tryed like this, but it’s dont work

@VictorPulzz What have you tried in the _redirects file?

I’m still a little confused as to what you want, since you said every not every, but if you want every request to /party/{anything} to load /party.html, that could be done with a redirect of:

/party/*  /party.html  200

If the value MUST be a number, then you could implement your own custom handling with Edge Functions as per what hrishikesh has linked.

yes I tryed it. But I’m lost then id.
For better understanding, I will describe the problem:
I have a mobile app. For it I make universal links (Universal Links - Apple Developer) . This app has a share button. So that I can share content. This content contains a link to my landing in the format https://site.com/party/{1313}
This link should open any one html file. And because I set up universal links to this url, the user can click on such a surface:
and open exactly what I shared with him (So I need this id in the link path to open the correct screen in the mobile application).

/party/* /party.html 200!
Thanks all

Hi @VictorPulzz :wave:t6: thanks so much for sharing your solution with the community! :blush:

1 Like

I was going to suggest using force, but couldn’t see any evidence of there being sub-files within /party/.

So I’m not sure why it would be required in this case.

Unless it’s due to /party/ and party.html being “the same thing”, with the default handling writing /party/ back to /party.html.

You started to be too smart, I just have a landing :smiley: