Search.../

baseUrl

Gets the base URL of the current page.

Description

Premium sites: Premium site baseUrl

Free sites: Free site baseUrl

Type:

stringRead Only

Related Content:

Was this helpful?

Get the base URL of the current page

Copy Code
1import wixLocationFrontend from 'wix-location-frontend';
2
3// Premium site URL: "https://www.domain.com/elephant?species=african-elephant"
4// Free site URL: "https://user_name.wixsite.com/zoo/elephant?species=african-elephant"
5
6let baseUrl = wixLocationFrontend.baseUrl;
7// Premium site: "https://domain.com/"
8// Free site: "https://user_name.wixsite.com/zoo/"