Super Clean URLs

As for why you can’t do this, here’s a description (excerpted from the link I share below):

BUT, to explain why there’s always going to be a page name. Consider the following:

Q: What page is represented by “https://funkyfuntestapp.bubbleapps.io” or in my case “https://grupz.com ”?
A: That’s the site’s index page. It’s the same as GRUPZ: Vacation Rentals in Palm Springs and Beyond | Vacation Rental Booking Tools | Vacation Rental Calendars .

Q: What happens if I construct a URL like “https:myapp.bubbleapps.io/[First][Last]”?
A: Well, [First][Last] will be interpreted as the page name. “Take me to the page called [First][Last] on that site.” Of course, unless that page has been created in the editor , that page does not exist and so it will 404, like so:


image.png2201x868 79.7 KB

Q: Could I pass a “path” type variable to the index page at all?
A: Yes, you could, but it would have to be done like this:


image.jpg2197x371 202 KB

Summary: I think you should see now why it’s just easier if there’s a page name (like “users”) before [First][Last].

NOW, clever workaround: You COULD put some logic on your 404 page such that, if there is something in the “path” (that is if “Get path from page URL is not empty”) you redirect to some other page. Like, if you get to the 404 page by https:myapp.bubbleapps.io/[First][Last], “Get path from page URL > Type: Path Type: text” will be the string “[First][Last]”. You could Navigate > /users/with_that_string

In other threads I’ve seen at least one user suggest that that is what they do. But THAT particular example was about a site with known categories (so the set of "path"s was not infinite. In the case of this FirstnameLastname scenario there are basically an infinite number of paths, right?

So what you’d want to do is the exact same search that I show you above. Only if that search results in thisUser (in my example) being non-empty would you redirect/Navigate.

If you don’t do that check, you will in fact NEVER display the 404 page. Because the URLs:

https://myapp.bubbleapps.io/JohnSmith and https://myapp.bubbleapps.io/a_page_that_does_not_existwould both be redirected to your profile type page. And you wouldn’t want that, of course.

Best regards,
Keith

For more discussion around this, see this post reply and the entire thread:

3 Likes