Pretty URLs with Dynamic Links - mydomain.com/dynamiclink - Solution from Zeroqode

Hi Daniel,
yes, our snipper is written so that any requests made to mydomain.com/dynamicurl will be redirected to mydomain.com/id/dynamicurl

1 Like

It’s done with the plugin ‘Browser’

49

2 Likes

Hi, @levon thanks for this tutorial! I’m having some issues setting it up…

Cloudflare does not accept the character ’ it seems. I get invalid errors when I enter them. Maybe I’m doing something wrong. Look at this:

image

So I replaced them with " probably not okay since it is not working for me. At least it no longer complains about line 1 when I remove ’.

image

Also, Cloudflare is updated and looks different now. They are linking to a new workers dashboard. There I set up a new subdomain (namehere.workers.dev) for workers which I don’t understand at all so I went back.

And I can enable the script but I can’t actually find where to add routes where the script is disabled. I think they moved the “routes” tab as well.

So what happens on my side?

  • On the live site, nothing, just 404 pages.

  • On Cloudflare preview I’m getting this error:

1cd7499bcfd2fht7ebc7f2c918d3170.cloudflareworkers.com redirected you too many times.

Also getting this in the CF preview mode console if it helps:
image

I should note that I didn’t pay for anything, Cloudflare says it supports 100k worker requests a day for free. Although you need to pay for workers KV, do we need workers KV support?

@levon Do you have an idea of what’s going on? Do you think you can show me your worker script now? How is it not invalid for you? And where do you add routes where the script is disabled?

Edit:

I see what’s going on here, when you copy the ( ’ ) character and paste it into Cloudflare, it turns into another invalid character.

See the difference when pasted:
image
We need to fix it manually to:
image

this is how the script looks for me

i see that they crate a separate dashboard for workers, but i can still access the old editor.
The routes indeed have been moved - i can see them now in the workers’ home page (when you go to cloudflare → choose domain - > click on workers - you see the option to add routes).
If the same script produces error I would suggest to reach out to cloudflare support or post on their forum.
We didn’t change anything on our side since posting this thread her and it still works.
i think though I have added my credit card details from the vey beginning and i’m getting charged about $5/month for the workers to run - maybe that’s the reason?
Thanks

1 Like

@levon My routes are not working as I think they should.

I have set my redirect script to: https:/domain.com/*

And a bypass on https:/domain.com/dash*


Now if I type https://domain.com/dash, it still redirects to https://domain.com/id/dash :frowning:

I can’t really explain this, any thoughts?

is solutions in this post still available regarding to the implementation of cloudflare on bubble ?

I guess it won’t work.
You’ll be using CNAME records with DNS only type (not proxied) and for the workers to run the DNS Records have to be actually proxied.

Thank you

Hey @levon! Did you manage to find a new workaround for pretty URLs (mydomain.com/dynamiclink) that takes the implementation of cloudflare on bubble into account?

Thank you,
Zack

Hi Zack,
the solution that we outlined in the first post still works.
check this out http://mydoors.to/demoproperty

I’ve spent days trying to get it to work :pensive: Your script works great but when my DNS records are proxied, bubble is no longer able to read them… Could you share how your DNS records are configured? Are you using bubbles A records?

yes, we use A records,
is your Bubble app new? When did you create it?
which IP addresses does your DNS point to?

My app is only a few weeks old. 3/4 weeks at most.

104.19.241.93
104.19.240.93

i switched zeroqode.com to these IP address with an A record and the proxy is on, seems to be working fine. But I’m not sure why it’s not working for you - maybe worth to shoot an emailto support@bubble.io ?

Thank you for showing me it’s possible! I have sent an email to Bubble support :slight_smile:

@levon Hi, how do you manage to get dynamic Metatag data for SEO title, description, and images to show for http://mydoors.to/demoproperty?

Hi John,
on the property page open the page properties (double click outside of the main canvas)
then set the dynamic values as on these screenshots:

hope this helps

Zero Code Conference 2020. October 7-8

Levon Terteryan

Founder @ Zeroqode

zeroqode-for-web-160x120

Bubble Templates

Zeroqode Blocks

Bubble Plugins

Bubble Courses

Convert Web to iOS & Android

No-code Development Services

I use URL Router plugin, but in ‘Do a Search for’ function for SEO, it doesn’t allow me to get path from the url. How do you make a search function work?

Let’s say: mydomain.com/id/thomas
How do you get the path “thomas” from the url since URL Router plugin is not allowed?

Appreciate your help!

Since going to domain.com/dynamiclink will lead you to a 404 page by default, it is technically possible to build out a profile page right on the 404 error page

@levon do you know if there’s any impact on SEO by doing that or if this is just a dumb idea?