#7. Magento 2: How to Configure URL Rewrites? – Magento 2.3

Here are the steps that you will follow in this Magento 2: How to configure URL Rewrites?:

To enable URL rewrites

Stores>Configuration> Web

Expand the Search Engine Optimization section

Set Use Web Server Rewrites to “Yes.”

When complete, tap Save Config

To set up automatic redirect

Stores>Configuration>Catalog

Expand the Search Engine Optimization section

Set Create Permanent Redirect for URLs

Save Config

Hi buddies,

When the rewrite goes into effect, any links that point to the previous URL are redirected to the new address. URL rewrites make it possible to make existing URLs more “search engine friendly” and also easier for humans to read. Enabling Web Server Apache Rewrites is part of the initial Magento 2 setup. Magento 2 routinely uses URL rewrites to remove the file name “index.php” that normally appears in the URL just after the root folder. When Web Server Rewrites are enabled, the system rewrites each URL to omit “index.php.” The rewrite removes words that convey nothing of value to search engines or customers and has no impact on performance or site rank. And today, we will learn how to set up URL Rewrites tool and Automatic Product Redirects.

How to enable URL rewrites?

Step 1:

On the Admin sidebar, tap Stores. Then under choose Configuration. In the panel on the left under General, choose Web.

Step 2:

After that, expand the Search Engine Optimization section

Step 3:

Set Use Web Server Rewrites to “Yes.”

Step 4:

When complete, tap Save Config.

Moreover, your store can be configured to automatically generate a permanent redirect whenever the URL key of a product changes. In the Search Engine Optimization section of the product record, the checkbox below the URL key indicates if permanent redirects are enabled for your catalog. If your store is already configured to automatically redirect catalog URLs, making a redirect is as easy as updating the URL key.

To set up automatic redirects, we do the following:

1

Stores>Configuration>Catalog

2

Expand the Search Engine Optimization section

3

Set Create Permanent Redirect for URLs if URL Key Changed to “Yes.”

4

Save Config

Step 1:

On the Admin sidebar, tap Stores. Then under Settings, chooseConfiguration. In the panel on the left under Catalog, select Catalog.

Step 2:

Expand the Search Engine Optimization section.

Step 3:

SetCreate Permanent Redirect for URLs if URL Key Changed to “Yes.”

Step 4:

TapSave Config.

Besides,to automatically redirect catalog URLs, we follow this process:
On the Admin sidebar, tapProductsand choose Catalog. Then find the product in the list, and click to open the record. In the panel on the left, choose Search Engine Optimization.

In the URL Key field, do the following:

Make sure that the Create Permanent Redirect for old URL checkbox is selected. If not, follow the instructions to enable automatic redirects.

Update the URL Key as needed, using all lowercase characters and hyphens instead of spaces. Then tap Save.

When prompted to refresh the cache and index, follow the links in the messages that appear at the top of the workspace. The permanent redirect is now in effect for the product and any associated category URLs. To view the redirect records, on the Admin sidebar, tap Marketing. Then under SEO & Search, choose URL Rewrites. The most recent permanent redirects appear at the top of the list.