Configure the base URL
-
On the Admin sidebar, go to Stores > Settings > Configuration.
-
Under General in the left panel, choose Web.
-
Expand
-
Base URL — Enter the fully qualified base URL for your store. Make sure to end the URL with a forward slash, so it can be extended with additional URL Keys from your store. For example:
http://yourdomain.com/
NOTE
Do not change the placeholder in the Base Link URL field. It is a placeholder that is used to create relative links to the base URL. -
Base URL for Static View Files — (Optional) Specify an alternate location for the base URL for static view files by entering the path starting with the following placeholder:
{{unsecure_base_url}}
-
Base URL for User Media Files — (Optional) Specify an alternate location for the base URL for user media files by entering the path starting with the following placeholder:
{{unsecure_base_url}}
For a typical installation, there is no need to update the paths for the static view files or media files because they are relative to the base URL.
NOTE
Placeholders enclosed in double braces are markup tags for variables. -
-
When complete, click Save Config.
Configure the secure base URL
If your domain has a valid security certificate, you can configure the URLs of both the storefront and Admin to transmit data over a secure (https) channel. Without a valid security certificate, your store cannot operate with secure (SSL/TLS) protocol.
-
Expand
-
Secure Base URL — Enter the full secure base URL, followed by a forward slash. For example:
https://yourdomain.com/
-
Secure Base Link URL — Do not change the placeholder in the secure base link URL field. It is used to create relative links to the secure base URL.
-
Secure Base URL for Static View Files — (Optional) Specify an alternate location for the secure base URL for static view files by entering the path starting with the following placeholder:
{{secure_base_url}}
-
Secure Base URL for User Media Files — (Optional) Specify an alternate location for the secure base URL for user media files by entering the path starting with the following placeholder:
{{secure_base_url}}
-
-
To enhance security, set both of the following options to
Yes
.- Use Secure URLs on Storefront
- Use Secure URLs in Admin
-
For Enhanced Security Settings, do the following:
-
Enable HTTP Strict Transport Security (HSTS) — If you want your store to display only secure HTTPS page requests, set to
Yes
. -
Upgrade Insecure Requests — To upgrade any requests for standard unsecured HTTP pages to secure HTTPS, set to
Yes
.
-
-
Set the Offloader Header for your server.
Most Commerce installations use the default
X-Forward-Proto
to identify the protocol as eitherHTTP
orHTTPS
. If your server configuration uses a different offloader_header, enter it here. -
When complete, click Save Config.