URL Reformatting - Pretty URL

This may be an easy one but I have yet to find a easy solution!

I have a database of blog posts and am currently using the slug to act as the URL page which results in a URL like this:
https://wishedby.me/post?slug=10-thoughtful-valentine%E2%80%99s-day-gift-ideas-for-her
Which is ok however I would prefer it to look like this:
https://wishedby.me/post/10-thoughtful-valentine’s-day-gift-ideas-for-her

This is to make it look nicer but also to give me the best SEO optimisation.

Note: These are not static pages but are dynamic based upon the blog post selected from a repeating group of blog posts.

I have seen a couple of responses from @john3 and @stephencharles but I don’t think these quite resolve the issue.

Any ideas welcome?

Many thanks.
Phil

Why are you using the slug as a query parameter, and not just in the URL path?

Assuming your Post page is set up with the correct content-type, navigating to a page, and sending the data, should automatically add the slug into the URL path, so you shouldn’t need to do anything to achieve what you’re trying to do - it’s the standard built in Bubble behaviour.

And even if your Post page doesn’t have a defined content type, you can still get the data from the URL path.

Maybe I’m missing something here, or misunderstanding your question - but you shouldn’t need to do anything…

So maybe clarify what the actual problem is here - i.e. why it’s not working as expected? - What have you tried? etc. (maybe you haven’t set your Post page up with the correct content-type?)

Hi. Here’s how it’s currently set up. This workflow is based upon the user clicking on an item within a repeating group on the home (index) page.

The post webpage then uses the slug to display the correct data. This all works fine.

From what you suggested I tried just deleting the ‘send more parameters to the page’ option but it doesn’t then look like the post title is in the url any more.

Firstly, I’m not sure why you need to do a search for the data to send - surely you can just send the current cell’s data (just to keep it simple)?.

Secondly, if your destination page has the content type Article then there’s no need to send any URL parameters to the page (the slug will automatically be set int he URL path and the destination page will automatically read it from there).

From what you’ve described it sounds as though your Post page isn’t set up to receive data (or at least not Article data) - if it was then it should work - but without knowing more about your data structure or you page settings it’s impossible to identify the problem.

Feel free to share more info and screenshots about how your destination page is set up to receive data.

Thank you my friend - you have steered me to the right path.

My ‘data to send’ search was a dummy search returning null (deliberately) and I was using the slug as the parameter to send to be able to display the correct data within the post webpage.

I had previously read somewhere that using the slug was good for SEO.

I have now amended the data to send to the current article and have realigned all of the data fields within the post page to grab the correct article from the current article rather than using the slug parameter within the url.

As you say this then enables the url to be as I wanted.

Happy days!

Many thanks.

1 Like

I’ve created a template that incorporates this concept as well as a heap of other SEO-friendly features.

1 Like

Sei que estou atrasado nesse posto, mas se vc usar REGEX para criar um slug, resolve seu problema a URL fica limpa