You’re not doing anything wrong. The workflow waits for the page to load therefore you see it visibly load.
Two options:
if you always want to redirect from this page (as in there are no conditions on this workflow), you can set up a redirect in your app settings.
if it is conditional (eg you first want to check if user is logged in): you can put everything on that page in one container group, set the visibility to hidden in page load, and include a condition on that group that says the opposite of your redirect condition e.g. if user is logged in, make group visible. That way although that page still loads, it does not display anything.
Oh. I assumed server-side loading would do a simple redirect without any rendering. Is there a way to do this?
App settings (as you suggested) wouldn’t work for me, as I need to redirect based on user’s profile slug (e.g. I need mydomain.com/vova redirect to mydomain.com/index/vova), and as you can understand there can be an arbitrary number of slugs.
(I have a single-page app, hence index/ and not users/)
Do you know if there’s a simple way to enable this?
You can maybe use url parameter? So that mydomain.com/?user=vova can be redirected to mydomain.com//vova
What you can also achieve is to have the index page without any element and type = Users. When page loaded, you’ll set a Workflow doing a redirect to the single page of your app. In this case, the index page is used as a simple “router”.
Another option could be using the Saasalias plugin. Not cheap but using it you can also create a subdomain vova.mydomain.com redirected to mydomain.com (with index page type = Users, and you set a workflow to set the user as the data source of the page, based on the subdomain). And this redirect can be transparent, that means that even if the redirect in mydomain.com/index/vova, your user will always see only “vova.mydomain.com”.
Depending on your needs and app goals, it can worth the price.
Now you can navigate within your single-page app by parsing Router’s path list as exemplified in @ZeroqodeTeam’s demo project
One thing to note is that the router Plugin for some example doesn’t catch up 1st Path/2nd Path in this case, but does catch the “Path list” parameter. Note that “1st Path” in this case is its item #3. Confusing, I know.
Thanks. I’m just not sure how search engines will treat this. See, I plan to have a lot of pages exposed (this can be /vova/some-project-name), which I want to be indexed. I’m not sure Google will understand that redirect and fetch the content correctly from the page. I will have to deploy before seeing if it works, though…
Yes, understood. You won’t be able to build a url using 2 successive dynamic page, but the free router plugin may help to get a solution close to your expectations. Not sure about Metadata and SEO, let us know!