Search...
prefix
Gets the prefix of a dynamic page's or router page's URL.
Description
Only dynamic pages and router pages have a prefix. The value of the
prefix
property for other page types is always undefined
.
Premium sites:
Free sites:
To learn more about dynamic page prefixes, see About URL Prefixes and Page Grouping of Dynamic Pages.
To learn more about router page prefixes, see About Routers.
Type:
stringRead Only
Was this helpful?
Get the prefix of the current page's URL
Copy Code
1import wixLocationFrontend from 'wix-location-frontend';23// Premium site URL: "https://www.domain.com/mammals/elephant?species=african-elephant#desc"4// Free site URL: "https://user_name.wixsite.com/zoo/mammals/elephant?species=african-elephant#desc"56let prefix = wixLocationFrontend.prefix; // "mammals"