prefix


prefixstringRead-only

Gets the prefix of a dynamic page's or router page's URL.

Only dynamic pages and router pages have a prefix. The value of the prefix property for other page types is always undefined.

Premium sites: Premium site prefix

Free sites: Free site prefix

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.

Get the prefix of the current page's URL
JavaScript
import wixLocationFrontend from "wix-location-frontend"; // Premium site URL: "https://www.domain.com/mammals/elephant?species=african-elephant#desc" // Free site URL: "https://user_name.wixsite.com/zoo/mammals/elephant?species=african-elephant#desc" let prefix = wixLocationFrontend.prefix; // "mammals"
Did this help?