# Super Clean URLs

**URL:** <https://forum.bubble.io/t/super-clean-urls/47120>\
**Category:** Need help\
**Created:** [January 17, 2019, 11:32pm UTC](https://forum.bubble.io/t/super-clean-urls/47120 "2019-01-17T23:32:57Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcuslate](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@marcuslate](https://forum.bubble.io/u/marcuslate)\
**Post date:** [January 17, 2019, 11:32pm UTC](https://forum.bubble.io/t/super-clean-urls/47120/1 "2019-01-17T23:32:57Z")

</div>

Hi,

I currently have my user profile URLs set up like [website.com/profile/username](http://website.com/profile/username)

Is there any way to make them just be [website.com/username](http://website.com/username) ?

I should make it clear I want people to link to their profile URL from other websites so the URL needs to stay the same. Google indexing would be nice too.

---

<div class="post-metadata">

**Author:** ![Kfawcett](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/kfawcett/32/38097_2.png) [@Kfawcett](https://forum.bubble.io/u/Kfawcett)\
**Post date:** [January 18, 2019, 12:19am UTC](https://forum.bubble.io/t/super-clean-urls/47120/2 "2019-01-18T00:19:06Z")

</div>

You can get close. [New feature available? "Field for a readable URL"](http://forum.bubble.io/t/new-feature-available-field-for-a-readable-url/22776/14)

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [January 18, 2019, 12:27am UTC](https://forum.bubble.io/t/super-clean-urls/47120/3 "2019-01-18T00:27:25Z")

</div>

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](https://funkyfuntestapp.bubbleapps.io/)” or in my case “[https://grupz.com](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](https://grupz.com/index) .

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  
 ](https://us1.discourse-cdn.com/bubble/original/3X/8/1/81c2cb32b74b1e7c39eb4b7369bf18f419b1ff74.png)

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  
 ](https://us1.discourse-cdn.com/bubble/original/3X/d/d/dd46263c9a671806d3c0fc2df3ec0e19a6aca65a.jpeg)

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](https://myapp.bubbleapps.io/JohnSmith) and [https://myapp.bubbleapps.io/a\_page\_that\_does\_not\_existwould](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:

> [@Showing IP Address for individual User Pages](http://forum.bubble.io/t/showing-ip-address-for-individual-user-pages/37507/7):
>
> Hey @brad.a.farley. In answer to your four questions: In my example, no. You might think you could hit this page with a User’s uniqueid at the end of it, but here’s what will happen: Of course, one could come up with a way to check for that. (For example, I suppose that unique IDs always begin with a number… at least right now… and so we could do some regex to check if the “path” starts with a number I suppose.) That’s exactly what this does. Right. There’s no redirection or …

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [January 18, 2019, 7:58am UTC](https://forum.bubble.io/t/super-clean-urls/47120/4 "2019-01-18T07:58:02Z")

</div>

You may be able to do something in your DNS settings to point [website.com](http://website.com) \> [website.com/profile](http://website.com/profile) under the covers.

I don’t think you can do it with a CNAME, as root redirection is a no-no.

There are several possibles, but you would need to pretty handy with the more technical side of webpage setup.

---

<div class="post-metadata">

**Author:** ![marcuslate](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@marcuslate](https://forum.bubble.io/u/marcuslate)\
**Post date:** [January 18, 2019, 1:18pm UTC](https://forum.bubble.io/t/super-clean-urls/47120/5 "2019-01-18T13:18:22Z")

</div>

@keith I don’t want to use redirects as a primary solution as that will be clunky, with changing the URL they typed to something else. Also it will be pretty slow as it has to load 2 pages(?).

If this is so hard/impossible in bubble, why do other websites like Facebook, Twitter and a ton of other websites do this easily?

> [@NigelG](#):
>
> You may be able to do something in your DNS settings to point [website.com](http://website.com) \> [website.com/profile](http://website.com/profile) under the covers.

@NigelG What would this do? And how does one go about doing this?

---

<div class="post-metadata">

**Author:** ![mike\_verbruggen](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/mike_verbruggen/32/171992_2.png) [@mike\_verbruggen](https://forum.bubble.io/u/mike_verbruggen)\
**Post date:** [January 18, 2019, 2:41pm UTC](https://forum.bubble.io/t/super-clean-urls/47120/6 "2019-01-18T14:41:57Z")

</div>

This is (almost) what you are looking for:

[https://slmmr-public-sandbox.bubbleapps.io/example\_username](https://slmmr-public-sandbox.bubbleapps.io/example_username)  
[https://slmmr-public-sandbox.bubbleapps.io/another\_example](https://slmmr-public-sandbox.bubbleapps.io/another_example)

This is some hack I stumbled on a week ago. It is using the 404 page, which is also the problem with this hack because Google will not index this page.

When Google visit this page, it receives a 404 status message which is telling Google this page does not exist. It would be great if @bubble gave us the option to control the status message a 404 page (or any page) is sending out.

I want to be able to use 404-page for dynamic pages and set the status to 200 (existing page) when Bubble finds a user in the database. And if Bubble is unable to find a user, it sets the status to 404.

Here you have a link to the editor:

> **[Bubble Editor - slmmr-public-sandbox](https://bubble.io/page?type=page&name=404&id=slmmr-public-sandbox&tab=tabs-1)**
>
> Build stuff without code and launch a startup without a tech-cofounder! Bubble is a visual programing language. Instead of typing code, use a visual editor to build applications.

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [January 18, 2019, 4:22pm UTC](https://forum.bubble.io/t/super-clean-urls/47120/7 "2019-01-18T16:22:09Z")

</div>

Well, the real way this is done is at the web server level. In Bubble, we do not have programmatic access to necessary web server functions to make this work _exactly_ the way LinkedIn (for example) does it.

Now, what I’m talking about above is all without rejiggering the URL displayed _in the browser_ address bar. Note that the Browser plugin allows you to do that.

So, to achieve (more-or-less) exactly what you want, you can (or may need to) combine techniques. The first thing, is what I’ve described in various places: That a page with what we might call a “custom path” must – just like a page where we refer to a Thing by some arbitrary value in a URL _parameter_ – retrieve the Thing in question from the database via a Search.

The second thing is that we may still desire to rewrite the visible URL in the browser (and again the Browser plug-in enables you to do this – its operation is a little funky and takes some experimentation).

I helped @marc2 with some of this in a simple-but-nifty app that he was building and perhaps he’ll chime in and post some tips.

This sort of thing comes up enough that – even though I’m not particularly interested in actually _doing_ any of this in a real app – I suppose sometime I should do a comprehensive demo project and video tutorial.

tl;dr: When using Bubble, you don’t have programmatic access to your entire web stack. This prevents you from doing some types of routing/URL rewriting that are used to do some types of URL customization. You can simulate/approximate such behaviors using a combination of techniques.

---

<div class="post-metadata">

**Author:** ![neerja](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/neerja/32/29814_2.png) [@neerja](https://forum.bubble.io/u/neerja)\
**Post date:** [January 18, 2019, 11:21pm UTC](https://forum.bubble.io/t/super-clean-urls/47120/8 "2019-01-18T23:21:58Z")

</div>

@mike_verbruggen this might be too complex for the purpose of 404 page

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [January 19, 2019, 12:50am UTC](https://forum.bubble.io/t/super-clean-urls/47120/9 "2019-01-19T00:50:34Z")

</div>

This is something people do though. In one of the follow ups to the post I referenced above, I describe something very similar. I’d not thought about the actual status msg return though.

(BTW, a workflow action to return status messages would be AWESOME in general as API Workflows sorely need this.)

---

<div class="post-metadata">

**Author:** ![marcuslate](https://avatars.discourse-cdn.com/v4/letter/m/c5a1d2/32.png) [@marcuslate](https://forum.bubble.io/u/marcuslate)\
**Post date:** [January 19, 2019, 11:19am UTC](https://forum.bubble.io/t/super-clean-urls/47120/10 "2019-01-19T11:19:19Z")

</div>

What I really want to do is let my users link to their profile via my URL ([mywebsite.com/theirusername](http://mywebsite.com/theirusername)) from other websites like YouTube and Twitter. And it stays that same URL the whole time. Google indexing is also important.

I don’t think any of the workarounds proposed here does that(?).

I think I will just name the page one letter ([mywebsite.com/u/username](http://mywebsite.com/u/username)) for now until I find a solution.

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [January 19, 2019, 6:18pm UTC](https://forum.bubble.io/t/super-clean-urls/47120/11 "2019-01-19T18:18:44Z")

</div>

ATM, this is the best and most “Bubbly” way to do it.

---

<div class="post-metadata">

**Author:** ![NigelG](https://avatars.discourse-cdn.com/v4/letter/n/ea5d25/32.png) [@NigelG](https://forum.bubble.io/u/NigelG)\
**Post date:** [January 20, 2019, 8:55am UTC](https://forum.bubble.io/t/super-clean-urls/47120/12 "2019-01-20T08:55:38Z")

</div>

> [@marcuslate](#):
>
> @NigelG What would this do? And how does one go about doing this?

You won’t much like it, but this is possible with a lot effort.

Two options …

1. Use an HTML frameset to pull in the “folder” page to the top level.
2. Set up Cloudflare on your domain, and then use their DNS flattening service to CNAME the root to the relevant page.

Nigel.

---

<div class="post-metadata">

**Author:** ![hgm.business](https://avatars.discourse-cdn.com/v4/letter/h/71c47a/32.png) [@hgm.business](https://forum.bubble.io/u/hgm.business)\
**Post date:** [January 23, 2019, 11:16am UTC](https://forum.bubble.io/t/super-clean-urls/47120/13 "2019-01-23T11:16:23Z")

</div>

You can use bubble’s ‘This url’ function to get the current url. Then use bubble’s ‘extract using regex’ with this code **.\*://?([^/]+)** to set a state as the ‘host’ component ([https://www.yoursite.com](https://www.yoursite.com)) of your website. Then set a state of ‘username’ using the ‘find & replace’ function by looking for ‘host/’ and leaving the ‘replace with’ field blank. This will take care of the slash between your url and the username. This process runs locally, i.e. instantly.

Step 1:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/9/f/9f3cd870b5e8faba1c38d1c174e225ee3a3696a7.png)

Step 2:

 ![image](https://us1.discourse-cdn.com/bubble/original/3X/d/7/d771ec77b6e2d78390d159dceba7cde9f0858501.png)

Henry

---

<div class="post-metadata">

**Author:** ![keith](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/keith/32/56020_2.png) [@keith](https://forum.bubble.io/u/keith)\
**Post date:** [January 23, 2019, 3:38pm UTC](https://forum.bubble.io/t/super-clean-urls/47120/14 "2019-01-23T15:38:29Z")

</div>

Except that parsing “somehost/path” is not what the OP is seeking to do.

He wants somehost/path (a page that does not exist) to redirect dynamically to a page that does exist (dynamically, based on the value of path) and then rewrite the browser’s URL to show somehost/path.

This isn’t actually possible in Bubble without throwing a 404 response before the redirect.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [March 28, 2019, 11:33pm UTC](https://forum.bubble.io/t/super-clean-urls/47120/15 "2019-03-28T23:33:03Z")

</div>

Closed on March 28, 2019, 11:33pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
