URL structure questions

Is it possible to achieve a url structure like this:

/cars - list of all cars, which will have a list block
/cars/{slug} - a specific car, which will have a list-details block

I know how to change the slug using SEO:slug, but how can I make the parent URL be the same one it falls under?

Hi @jclay12345. This is a totally reasonable URL scheme! Unfortunately, it’s a bit outside the way Softr is designed to work.

It would be helpful to understand why this particular scheme is important in your use case, but without knowing that, here are a couple of thoughts.

  1. If you need this scheme for incoming URLs but it’s not necessary that the URL that the user sees actually looks like this, then you can add some custom code on the /cars page that looks to see if there is a record ID on the URL, and if there is, it does a location.replace() to a /cars-detail page.

  2. If you really need the URL that the user sees to be /cars/{slug}, then if you can live with the SEO:Slug format, one possibility would be to put both a list block and a list details block on that page, and write some custom code that hides one or the other of these blocks depending on whether there is a record ID on the URL.

If you can tell me which of these cases applies, I can help with that custom code.

Thanks! It’s mainly for SEO to have a clear folder structure. So it would matter what search engines see. I’m not sure which case that is.

Thanks for the additional information.

Just so I’m totally transparent here: My bias is that I’m usually skeptical of trying to twist Softr in knots in order to accomplish an SEO goal. The reason is that the cost of not doing things the Softr way can be an ongoing tax on your development, and the benefit can be really hard to quantify.

What’s the evidence that the scheme you’re proposing would work better for SEO than Softr’s automatically generated sitemap.xml?

I really don’t have any evidence. I just wanted it to be as clean as possible. I guess I could go the singular route for the individual case … /car/{slug} or /cars/details/{slug}

and I understand that the URLs will have the /r/{id} at the end.

For what it’s worth, I think having one slug for the list and another slug for an individual record detail is very common across the web, so I’d be surprised if there’s much of an advantage to going outside that scheme.

It is important is that you make sure that all your pages are appearing in your automatically generated sitemap.xml. The two most likely reasons that details page wouldn’t appear there are 1) if SEO:Index is set to false for the record in Airtable, and 2) if the page is behind a login.

I’d recommend hand-verifying your sitemap.xml from time to time and ensuring that you see what you expect to see there.

Awesome, thank you!!!