baseUrl


baseUrlstringRead-only

Gets the base URL of the current page.

Premium sites: Premium site baseUrl

Free sites: Free site baseUrl

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