Question regarding routing

I have a signup page in the directory /users> i.e. /users/register.php

I wish to redirect on success to myprofile.php so I have a route defined as:

image

Giving this in the .htaccess file

image

I use a browser goto() in server action success event pointing to “myprofile”

image

But the page, on success, redirects to

/users/myprofile giving a 404 error

Not, as i would expect

/myprofile which works correctly

Must be missing something obvious, never had this issue before

Anyone help?

1 Like

Hi @Hyperbytes, make sure to add the / in front of myprofile, but after the '.

So it should be browser1.goto(’/myprofile’)

Thanks @scott that did the trick, guess that’s another bug report to submit, picker sets route incorrectly

It is something that I have noticed that might need to be improved upon. Depending on your routing settings (document vs. site), the / might need to be added or not added.

I normally like relative to site over relative to document but i recall there were issues with routing in the early days if things were set relative to site so I tend to leave settings at the default, relative to document

Hi Brian, how exactly do you add this? How/what do you select in the gotourl action?

Via the picker

Currently set (manually)

Select route picker

select route

Route is missing “/”

That is strange. I just tested this and it sets the link properly:

What are your site links set to - document or root relative? In my example the links are document relative.

Currently set to Document

Then it’s the same. Unfortunately i cannot recreate this.
What is the structure you are using i.e. where is the page you are redirecting from located?
Is this a SPA or just plain URL rewrite?

plain URL rewrite

all,pages are in a sub directory “users”

image

register.php is a pretty standard user registration

The redirect is called from the success event of the registration form to myprofile.php using route "

With the route set as

I will pm you a link

This has been fixed in Wappler 2.3.0

1 Like

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