Configuring base URL redirects and web server rewrites in Magento 2 is important for maintaining a clean URL structure, avoiding duplicate content issues, preserving link authority, and improving the performance of your online store.
Click on STORES >> Configuration
Go to Web (Under General)
Make sure “Add Store Code to URLs” is set to NO.
This ensures that URLs are descriptive and easy to read and doesn’t contain unneeded characters about your store.
By setting “Add Store Code to URLs” to NO, you ensure that your store’s URLs are clear, descriptive, and easy to read. This not only enhances the user experience but also makes your website more search engine-friendly.
Don’t change it when it’s already set to no, then click on the Default Config in the upper left corner.
Click on Default Store View >> OK
Uncheck the “Use Website” option to change the field then Select Yes
On the field
Auto-redirect to Base URL uncheck Use system value then set it to Yes (301 Moved Permanently) to make sure that link authority is passed whenever there are redirects. While this has been a long debate on whether 302 links still pass authority, 301s are best used.
Modifying the “Auto-redirect to Base URL” to “Yes (301 Moved Permanently)” is important for maintaining link authority during redirects. This is crucial for search engine optimization (SEO) as it ensures that when a URL is redirected, the link authority is passed correctly, contributing to better search rankings.
Select Yes from “Use Web Server Rewrites” if it’s set to No
You can see from the image above that the the “Use Web Server Rewrites” is already set to yes. But what does it actually do?
Web server rewrites can improve the performance of your Magento 2 store by allowing the web server to serve rewritten URLs directly without the need for additional processing. This can result in faster page load times and a better overall user experience.
This option allows Magento to leverage web server rewrites (e.g., Apache’s mod_rewrite) for handling URLs, resulting in faster page loads and a more efficient user experience.
When done, make sure to “Save Config”
These configurations help create a streamlined and SEO-friendly structure for your Magento 2 store. Clean URLs contribute to a positive user experience, while proper redirection and web server rewrites enhance search engine rankings and overall site performance. It’s essential to make these adjustments to ensure that your online store is both user-friendly and optimized for search engines.