You can configure Magento to generate search engine-friendly URLs by following these steps:
- Login to the Magento admin panel.
- Go to Stores -> Configuration -> General -> Web.
- Expand the Search Engine Optimization section.
- Set Use Web Server Rewrites to Yes.
- Set Add Store Code to URLs to No, unless you have multiple stores and want this feature.
- Set Server URL Rewrites to Yes.
- Set Use Secure URLs on Storefront to Yes, if you have an SSL certificate installed and want to use secure URLs.
- Save the configuration changes.
Magento will now start generating search engine-friendly URLs for your store. If you want to customize the URL structure further, you can use the URL Rewrites tool in the admin panel to create custom URL rewrites for specific pages and categories.