Wix.location to a internal page not working? (solved)

I have touble making this work… Please help

My page name is STAALPLADER
This is my code

import wixLocation from "wix-location";

export function SortimentButton_click(event, $w) {
	wixLocation.to("/STAALPLADER");
	
	console.log("Staalplader");
}

but when i click on the button… it doesn’t link to my page…

I have tried publishing the site, but no luck

Go to the page settings panel, to the SEO tab and search for the page URL.

Does anybody know how to do this to a dynamic page where I need the url to include the _id of the current item at the end. I have been messing around with this for a couple days and not managing to get this right.

import wixLocation from 'wix-location';
    
export function buttonEdit_click(event) {

    const currentItem = $w("#dynamicDataset").getCurrentItem(_id);
    wixLocation.to("/edit-people/" + currentItem);

I am not even sure its possible this way from reading the api documentation, but it doesn’t seem to work if I use the GUI to “link to page” and also connect the button to the data source.

Just to note, that “#dynamicDataset” has been used on both pages

I have the following but it doesn’t work. I have copied the SEO link and from the Go to URL page it shows an error 404 page i.e. page does not exist

import wixLocation from “wix-location”;

export function button18_click(event, $w) {
wixLocation.to.to(“/tutorial-6-upload-image”);

console.log(“tutorial-6-upload-image”);
}

@adcatch02 delte one of the .to
So it’ll be:

 wixLocation.to("/tutorial-6-upload-image");