With a big catalog of 224+ extensions for your online store
How to Configure Store URLs in Magento 2
Every Magento store has a base URL and another admin URL. Configuring Store URLs in Magento 2 enables you to easily move the whole store to another location without having to update all of the URLs. Hence, understanding exactly about the configuration of store URLs as well as all types of URLs is necessary for you in developing a Magento 2 store. There are 3 types of URL, for example:
Base URL
http:// www.yourdomain. com/magento/
Secure Base URL
https:// www.yourdomain .com/magento/
URL with IP address
http:// ###.###.###.###/magento/
Your default Magento site owns a base URL and an Admin URL assigned to storefront and storeback respectively. If you plan to have multiple stores, you should include the store code in the URL.
Following the guide given below to create the Store URL for your own Magento 2 store.
To Configure Store URLs in Magento 2
Configure the Base URL
- On the Admin Panel,
Stores > Settings > Configuration
. - On the left panel, under
General
, selectWeb
. - Open the
Base URL
section,- Fill the
Base URL
for the store, however, the URL needs to end with a forward slash to extend the link with the additional URL later. For example,
- Fill the
http:// yourdomain.com
In the Base Link URL
field, the placeholder link is available and used to create relative links to the base URL. Don’t edit it!
- It is optional if you want to create an alternate location of the
Base URL for Static View Files
, for example:
{{unsecure_base_url}}
- It is optional if you want to create an alternative location of the
Base URL for User Media Files
, for example:
{{unsecure_base_url}}
Save Config
to complete.
Insert the store code in URLs
- On the Admin Panel,
System > Settings > Configuration
. - On the left panel, under
General
, selectWeb
. - Open the
URL Options
section: - Choose
Yes
in theAdd Store Code
as you need.- 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
- Click
Save Config
to complete. - When prompted, click on
Cache Management
link to flush the cache.
Configure the secure Base URL
- Open the
Base URL (Secure)
section,- Fill the full
Secure Base URL
and the end character is a forward slash. For example:
- Fill the full
http:// yourdomain.com
- In the
Secure Base Link URL
field, the placeholder link is available and used to create relative links to the base URL. Don’t edit it! - It is optional if you want to create an alternative location of the
Secure Base URL for Static View Files
, for example: - It is optional if you want to create an alternative location of the
Secure Base URL for User Media Files
, for example: - In the
Use Secure URLs in Frontend
, chooseYes
if you want to run the entire storefront over a secure (https) channel. - In the
Use Secure URLs in Admin
, chooseYes
if you want to run the entire admin over a secure (https) channel.
- Click
Save Config
to complete.
Store URLs configuration needs to be done to solve the store moving problem. Once you have completed these settings, you can be rest assured that the store links are always updated. Thanks for reading, and good luck setting things up! Drop your comments below so that we can discuss further, just in case!
Related Topics:
- Add Google Tag Manager to Magento 2: Extension or Manual Installation
- Create a New Store View
- How to Edit Store View
- Setup Multiple Stores
- How to Change Store Scope
- Search Engine Friendly URL - URL Rewrite
- Create Product URL Rewrite
- Create URL Rewrites in Magento 2
- Get store information in Magento 2
Looking for Magento Development Company?
8+ years of experiences in e-commerce & Magento has prepared us for any challenges, so that we can lead you to your success.
Get free consultantRecent Tutorials
How to insert Order Attributes to Transactional Emails
How to insert Order Attributes to Transactional Emails
How to add Order Attributes to PDF Order Template
Explore Our Products:
People also searched for
- store url magento 2
- store url in magento 2
- magento 2 add store code to urls
- magento 2 store url
- magento 2 store code in url
- magento add store code to urls
- base url for static view files
- magento 2 base url for static view files
- magento 2 url structure
- magento 2 store view url
- base url for static view files magento 2
- magento 2 media url
- magento 2 base url
- add store code to urls magento 2
- magento store url
- magento 2 set base url
- magento store view url
- magento 2 store url in cms page
- how to change base url in magento 2
- change base url in magento 2
- 2.3.x, 2.4.x
Stay in the know
Get special offers on the latest news from Mageplaza.
Earn $10 in reward now!