5 (100%) 1 vote

Each website in a Magento installation has a base URL that is assigned to the storefront and another URL that is assigned to the Admin. If you have a security certificate for your domain, you can configure either or both base URLs to use all Magento resources and operations. There are three kinds of base URLs:

  • Base URL http://www.yourdomain.com/magento/
  • Secure Base URL https://www.yourdomain.com/magento/
  • URL with IP address http://###.###.###.###/magento/

The base URLs that are associated with your store were initially set up during the Web Configuration step of the Magento installation. If you had a security certificate available at the time, you could also choose to use secure (https) URLs for the store, Admin, or both. If you
didn’t have a domain or security certificate at the time of the installation, make sure to update the configuration before launching your store. Besides, if your Magento installation includes multiple stores, or if you plan to later add more stores, you can have the option to include the store code in the URL. but don’t forget not to change the Admin URL from the default Base URL configuration.

How to configure the Base URL?
Firstly, from the Admin sidebar, tap Stores then choose Configuration. In the panel on the left, under General, choose Web. After that, expand the Base URL section, and do the following:

  • 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/
  • 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.
  • (Optional) To specify an alternate location for the Base URL for Static View Files, enter the path starting with the following placeholder: {{unsecure_base_url}}
  • (Optional) To specify an alternate location for the Base URL for User Media Files, enter 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.

Magento 2 base URLs configuration

When complete, tap Save Config.

How to include the store code in URLs?
On the Admin sidebar, tap Stores. Then under Settings, choose Configuration. In the panel on the left, under General, choose Web and Expand the URL Options section.

Magento 2 base URLs configuration
Set Add Store Code to your preference.

URL with Store Code

http://www.yourdomain.com/magento/store-view/index.php/urlidentifier

URL without Store Code

http://www.yourdomain.com/magento/index.php/url-identifier

When complete, tap Save Config . After the setting is saved, you will be prompted to refresh the cache. Tap the Cache Management link in the message at the top of the workspace. Then, follow the instructions to refresh the cache.

How to configure the secure base URL?

If your domain has a valid security certificate, you can configure the URLs for either the storefront and Admin—or both—to run over a secure (https) channel. Without a security certificate, your store cannot automatically switch to a secure channel (https) for transactions
that normally take place over an encrypted, secure socket layer (SSL).

Firstly, expand the Base URLs (Secure) section. Then, do the following:

Magento 2 base URLs configuration

Base URLs

  • Enter the full Secure Base URL, followed by a forward slash. For example: https://yourdomain.com/
  • Do not change the placeholder in the Secure Base Link URL field. It is a placeholder that is used to create relative links to the secure base URL.
  • (Optional) To specify an alternate location for the Secure Base URL for Static View Files, enter the path starting with the following placeholder: {{secure_base_url}}
  • (Optional) To specify an alternate location for the Secure Base URL for User Media Files, enter the path starting with the following placeholder: {{secure_base_url}}
  • If you want to run the entire storefront over a secure (https) channel, set Use Secure URLs in Frontend to “Yes.”
  • If you want to run the entire Admin over a secure (https) channel, set Use Secure URLs in Admin to “Yes.”

When complete, tap Save Config.

Check our Magento plugins / Magento 2 plugins now 

Your Magento website needs a powerful Magento ERP for stock control.

DON'T MISS THE CHANCE!

magento erp

(1). How to create Store View in multi languages and translated Products & Content in Magento 2?
(3). Magento 2: How to change Admin URL?
Tagged:

Leave a Reply

Your email address will not be published. Required fields are marked *