[Fixed] – “Failed to Load Resources” Error After Magento 2 Installation

[Fixed] - "Failed to Load Resources" Error After Magento 2 Installation

Ever faced an issue of “Failed to load resource: the server responded with a status of 404 (Not found)” for CSS and Js after installing Magento 2 on Wamp server windows?

[Fixed] - "Failed to Load Resources" Error After Magento 2 Installation 1

Try one of the below methods to get the solution:

Solutions for “Failed to Load Resources” Error After Magento 2 Installation:

Solution 1:

Give proper permissions, enable apache rewrite_module and refresh apache server.

Run the following command from Magento root for fixing the frontend:

Clear var directory except .htaccess file and check admin.

If you get 404 page, there may be an issue of Symlink. Edit apache config file

Note: Implement this only if you are using apache.

Replace the below code:

with:

Note: Change AllowOverride None to AllowOverride All

Restart apache sudo service apache2 restart and check admin. It fixes the admin 404 issue.
Moreover, make sure, you don’t leave /app/etc/ directory writeable.

Solution 2:

Css and js is created at run time in pub/static folder.

At first, if css and js is missing, run the below command:

For Windows:

For Linux of ‘git bash’:

Solution 3:

Update the .htaccess file under /pub/static folder.

Open MAGENTO_DIR/pub/static/.htaccess and add the below code:

Instead, you can also disable static file signing by adding this record into the core_config_data table with this query:

Solution 4:

If you are using Magento 2.3.X version, this solution is for you:

Change the above foreach loop to run our Magento with no further issues on this:

Hopefully, you are able to fix the error with one of the above solutions.

If you need any help in implementing them, feel free to mention it in the Comments section below.

Thanks!

Get Weekly Updates

Never miss Magento tips, tricks, tutorials, and news.

Thank you for subscribing.

Something went wrong.

5
(based on 20 Reviews)

Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. Owing to his contributions in Magento Forums and posting solutions, he is among the top 50 contributors of the Magento community in 2019. When he is not engrossed with anything related to Magento, he loves to play cricket.

6 comments On [Fixed] – “Failed to Load Resources” Error After Magento 2 Installation

Leave a reply:

Your email address will not be published.