Wappler Routing to Static Pages Works but Routing to Dynamic Pages Fails

Hello Fellow Wapplers,
Using Wappler 3.0.1 on Windows 10 developing on an Apache staging server we were able to successfully create a summary page that contains a repeat of blog summaries (6summaries.php). Thanks to @Hyperbytes excellent support we were able to configure the blog title as a link that passes the blogid variable through the URL to reach the blog/detail page …com/6detail.php?blogid=2

OUR OBJECTIVE
is to use Wappler Routing to create a friendly URL formatted like: domain.com/categoryname/blogtitle

SUCCESSFULLY ROUTING TO STATIC PAGE
We followed the docs here: https://docs.wappler.io/t/url-rewriting-with-wappler/6254 and was able to successfully use the Wappler Routing panel to reach the blog summary page with the following “friendly” URL. Correct me if I am wrong but doesn’t this confirm the Apache server is configured for routing.

ROUTING TO DYNAMIC PAGE FAILS
However we can’t get the routing to work with dynamic data to the blog/detail page. We can successfully reach the wanted URL but the page content is blank?!
our-routing-configuration-to-dynamic-page-fails

SEARCHING THE COMMUNITY
we found a “Routing with dynamic parameters” Routing with dynamic parameters - Am i missing something obvious? discussion from July 2019 with @Hyperbytes @TomD & @scott We tried @hyperbytes solution of “manually adding a period (./) to the start of the link” and that failed too.

Continuing our search we found “SPA Tutorial Needed. Data Detail Views” SPA Tutorial Needed. Data Detail Views covering “Route Related Parameters” from April 2019 with a similar issue with @brad @Teodor @MH2ag & @George discussing “params” as the new collection for route related parameters. This lead to SPA routes with master detail view (dynamic URL) with @George suggesting the Wappler docs needed to be updated. We were unable to locate updated docs on this issue.

REWRITING URL PARAMS IN NODEJS
I understand from @emiel & @patrick there is an issue with Rewriting URL Parameters in NodeJS Rewriting with URL parameters in NodeJS but we are “Not” using NodeJS.

We attempted to configure Wappler Routing to a friendly URL multiple times, searched the docs, community and Google but still cannot find a solution. Any guidance of where we should look for a solution to configure “Wappler Routing to Dynamic Pages” would be greatly appreciated. Thank You!

JUST AS AN ASIDE
Creating blog summary and detail pages in Wappler takes less than 5 minutes. Wappler is incredibly fast.

Here is how i have it sety up on one of my sites which workks as you want.
Its an apache/PHP setup like yours

The routing is as below
image

and at app conect side an anchor button is set as below

image

Dont forget to define your parameter in app connect on the receiving page

Hi Brian, Thanks for getting back. I have to be missing something really simple probably hidden right in front of my eyes. I would be grateful and really appreciate your caring set of eyes and expert experience reviewing my configuration. I copied your screen shots to the best of my ability except using my /path/filenames.I would really appreciate it if you can tell me where I am going wrong.

01-Sending Blog Summary Page Dynamic Link Attributes & Route Config Similar to Brian’s

02-Receiving Single Page Blog Post Page Query Param blogid is set

03-Receiving Single Blog Post Page GET.blogid EQUALS the database id field

04-Receiving Single Blog Post Page is Blank and the URL is incomplete

05-When we configure the blogtitle in the Dynamic link attributes of the Sending Page the URL is correct but the page is still blank. I’m a newbe but I “feel” the blogid is not being passed from the Sending Blog Summary page to the Receiving Single Blog Post page.
our-routing-configuration-to-dynamic-page-fails

Any guidance you can provide would be greatly appreciated. Thank You!

The issue is, you are filtering the database query by the blog id, which expect a query parameter blogid in your URL but it is missing.

You should also send it in the URL, for example like:

https://yoursite.com/123/blog-title-here

and you currently have:

https://yoursite.com/blog-title-here

without the ID there … so the query cannot be filtered.
BTW it’s already explained how to do all of this here:

Also, it’s not a great idea to have spaces in the URL. Apply the slugify formatter to the blog title in your href (link), so it becomes from blog title here to blog-title-here

Hi Teodor, Thank You for interrupting your well deserved summer holiday to assist a Wappler newbe. I followed Brian’s advice and was able to successfully configure the Blog Title in the summary page to pass the blogid in the url to the blog post page. Please see screen shots below.


I have reviewed the Wappler docs, community etc. and What I have not been able to figure out is how to configure an SEO Friendly URL to replace this:
domain.com/6detail.php?blogid=2
with this:
domain.com/categoryname/Bagels for Breakfast

Can this be done using Wappler Routes or do I need to do something else?

BTW, I of course agree with your comments about spaces in the URL and will look into the slugify formatter. Thank You for your suggestion & assistance. I look forward to hearing from you.

If you filter your query by the ID you need to send it as well.

domain.com/categoryname/Bagels for Breakfast

should become

domain.com/categoryname/2/Bagels for Breakfast

Teodor, Thank You for your prompt reply.
We configured the Dynamic Link Attributes of the Anchor Image with the blogid and blogtitle

Unfortunately, the Page is Blank

Wappler does everything else so simply and easily I just have to be missing something really simple in my configuration, I just don’t know what. Your expert guidance would be appreciated. Thank You again, I am really grateful for your support especially during your summer holiday! :beach_umbrella: or is it :beers:

Just a thought: perhaps the spaces in your URL are causing issues?

Please post a screenshot of the routing panel where we can see what have you defined exactly for the path.

another thought: did you upload your .htaccess file?

Thanks Brad, Really appreciate your support and suggestion. Unfortunately we still get the same blank page with the spaces removed.

Thanks Teodor, Here is our Wappler Routing Configuration

Yes another excellent thought and Thank you for your assistance. Here is a screen shot of the htaccess file on the server

It appears to be in order but I have to admit I am not a code expert.

Do you have a live link where I can check this page?

Hi @Teodor , WAPPLER ROUTING SUCCESSFULLY TO DYNAMIC PAGES now that it is configured correctly. You were correct, the issue was the meta tag being corrupted “after multiple attempts to configure”. I ripped the routes and meta tags out and reconfigured correctly and routing is working as expected.

ROUTING META TAG PROPERLY CONFIGURED

FRIENDLY URL IN BROWSER

I would like to Thank @Hyperbytes @brad @MH2ag @psweb @Antony and of course our hero @Teodor for your expert guidance and assistance. I give the Wappler Community :beer: :beer: :beer: :beer: :beer:
(If Google can use stars, why can’t we use beers?

1 Like

Hello Teodor,
I was following your recommendation about the space in the url.
I made change to request to replace space by underscore. Many other url were working fine until I had:
url2 url .

The url with (’) does not display the query:
What do you recommend here?

Thank you for your input.