How To Remove Version Number In File Paths in Magento 2

How To Remove Version Number In File Paths in Magento 2 4

Magento 2 offers a feature of static content signing to invalidate the browser cache for static resources. To do so, it adds a deployment version to the URL of the static files.

However, these files’ URLs contain the deployed version due to which 404 error occurs.

The solution is to remove version number in file paths in Magento 2 and there are two methods given below for the same.

Methods to Remove Version Number In File Paths in Magento 2:

Method 1: From Admin Panel

  1. Login to admin panel
  2. Go to Stores > Configuration
  3. Under Advanced, select Developer
  4. Expand Static Files Settings
  5. Set “No” to Sign Static Files

How To Remove Version Number In File Paths in Magento 2

Method 2: Run the below commands

Now, run the below commands
Try any of the above methods to disable static content signing in Magento 2.

Use the Comments section below to mention any doubts on the topic and I’d be happy to help.

Feel free to share the solution with fellow developers via social media.

Thanks.

 

5
(based on 4 Reviews)

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. When he is not engrossed with anything related to Magento, he loves to play cricket.

Leave a Reply