How To Remove index.php From URL In Magento 2

Optimizing URL length makes your website SEO friendly. In this post, I will guide you on How To Remove index.php From URL In Magento 2.

For example, your URL when index.php has not been deleted is https://www.yourdomain.com/index.php/blog. Do you find it very long and difficult to read? Optimizing your URLs not only solves the problems above but is also SEO-friendly.

Google encourages the URL structure to be as simple as possible, and Google Bot will also prioritize that URL. It’s great that Magento 2 supports the feature that allows you to remove index.php with just the following simple steps:

Note: This method only works if mod_rewrite is enabled.

Steps To Remove index.php From URL

Step 1: Log in to Admin Panel.

Step 2: On the Admin Panel sidebar, go to Stores > Settings > Configuration.

Step 3: In the left panel, choose GENERAL > Web.

Choose-General-Web

Step 4: Expand the Search Engine Optimization section.

Expand the Search Engine Optimization section

Step 5: Set Use Web Server Rewrites to Yes.

Set Use Web Server Rewrites to Yes

Step 6: Scroll down under Base URLs, expand the Base URLs (Secure) section.

Expand the Base URLs (Secure) section

Step 7: Set Use Secure URLs on Storefront to Yes.

Set Use Secure URLs on Storefront to Yes

Step 8: When complete, click Save Config button.

This is the end of the How To Remove index.php From URL In Magento 2.

Follow us for the more helpful posts!

We hope this is a useful post for you.

You can read more useful posts like How To Redirect Customers To The Previous Page After Login In Magento 2.

Thank you for reading!

4.8 4 votes
Article Rating

Aaron LX

Aaron is a passionate writer, crazy about shopping, eCommerce and trends. Besides his outstanding research skills and a positive mind, Aaron eagerly shares his experience with the readers.

Leave a Reply or put your Question here

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x