Param in url not working

Hi,
I have created and published a page with this structure mydomain.com/{slug}

I have published it, extract the slug from URL with the predefine variable on page load and fetch the endpoint with it. I have a 404 error my page doesn’t show up. what’s wrong?

1 Like

Where is the data stored? In a dynamic collection or static?

If you’re using a slug and dynamic data, you have to make sure the API is getting the ID of the record you are fetching. Either by passing it in on the frontend to the GET. Or querying it on the backend by slug.

If you’re using a slug and static data, you can just filter the collection on the slug, provided that the slug is in the collection.

It is easier to help if you post some video or screenshots, as there could be many reasons why your page is 404.

the data is coming from xano, the backend request is working in my weweb editor not on the published page.

The app is getting the slug and query it against the database (it works like an id as each slug is unique)

I applied the filter to the backend as it will crash the front end otherwise over 200 slugs in total.

Here is an idea about the entire flow, I didn’t go through the xano part as the data retrieve is the correct one within weweb

Is the page loading correctly in the editor? That part I didn’t see but I think you mentioned it.

Not sure if it will solve the problem, but you don’t need a page workflow. You can bind the collection directly to the page parameter.

yes everything is good in the editor. I tried to bind directly the data but didn’t work either

Any idea @Alexis ?

It may not be possible to have a page with only a variable, without any prefix, could you try again by adding something before the variable, like /sports/martiallink ? If it works then we should rework the UI to prevent you to do it, or make it works

2 Likes

Hey I confirmed it’s working now. What would it take to make it available without any prefix?

You can create a bug ticket, we will either make it not possible anymore and create a product ticket internally, or make it possible if we figure out we can easily :slight_smile:

1 Like

hahaha okay let’s pray for the 2nd option

Wouldn’t have thought of that. In a similar vein, it’s interesting we can’t add prefixes to static page collections. That would be nice.

1 Like

Hey @Alexis I hope you had a great weekend, I can see that this ticket is under dev. Do you know if it would be achievable? (if so, when more or less?, I need it to launch)

What is the status of this? Can you link the bug that is in progress?

1 Like

Hi, it’s in review and should be released in early August

1 Like

Any updates?

It’s in QA, there is an inconsistency in the behavior we have in the editor and in the published app, so it’s still work in progress

1 Like

thank you

any updates? really hoping to shorten URLs but this is a blocker :confused:

it has been fixed, however if you use a dynamic variable and want it to be dynamically indexed you’ll have an issue with cloudflare worker.

2 options ;

  1. You don’t need indexation in this case go ahead.
  2. You need those pages to be indexed in this case you need to add something in your URL yourdomain.com/m/{dynamicvariable}

What was fixed? I thought the problem was url path variables don’t work without a prefix (e.g. mydomain.com/{slug} wouldn’t work) - and from what I can tell that is still broken. @Alexis can you confirm the scope/status of this (or link the bug ticket)