Enabling SEF URLs in Magento 2

Updated on Mar 13, 2019

Search Engines will craw your website in order to index all of your Store’s content and products. To make this process more efficient you can optimize your Magento 2 website by enabling Search Engine Friendly URLs (SEF URLs). This will also make your URLs easier to read by your customers and on websites when they are being shared. Usually this feature is enabled by default, but if you are not seeing the URLs as they should be you will have to re-enable it.

To activate the SEF URLs for your Store, you will need to first login to your admin dashboard and then navigate to the Stores → Configuration → Web section.

Navigating the Configuration menu in Magento 2

Now simply select Yes from the drop-down menu on the Use Web Server Rewrites option.

Enabling SEF URLs in Magento 2

Magento uses the Apache mod_rewrite to create the SEF URLs. If your Magento store is installed in the root of your domain (http://domain.com) you will not have to perform any changes in this file. However, if your Magento store is located under a subdirectory (http://domainc.om/magento/) you will need to edit the .htaccess file by changing the following line:

#RewriteBase /magento/

to

RewriteBase /your-magento2-folder-here/

Congratulations, your store now uses Search Engine Friendly URLs.

On this page...

    Magento 2 Hosting

    • Free Installation
    • 24/7 Magento Support
    • Free Domain Transfer
    • Hack-free Protection
    • Fast SSD Storage
    • Free Cloudflare CDN
    • Free Magento Transfer
    • Immediate Activation
    View More