0

So we have a site and when i view source there is a Link Rel="stylesheet" line entry which fetches a stylesheet. When i click this link in view source it leads to empty page as in not found, so i want to remove this Link Rel entry from my head section.

I have checked the head.phtml for the theme and couldnt find the entry. I have also checked the local.xml file and there is no such entry. I have also checked the head.phtml for the base/default/ dir and no love.

How can i remove this link from my head section when the file it is trying to call and the directory it thinks it is in does not actually exist at all.

  • Please check if your CSS is merged or not from: System -> Configuration -> Advanced -> Developer -> CSS settings – aman Mar 20 '18 at 1:57
  • It is not merged – Matt Godwin Mar 20 '18 at 13:15
  • Can you share the css filename and the URL of your website? – Mohit Kumar Arora Mar 21 '18 at 4:53
1

Magento searches for a CSS/JS/image resource in the following manner:

  1. Current theme directory
  2. Default directory (if exists) of the current theme package
  3. Default directory under base theme package

If Magento does not find the resource in any of above paths, then the resource is considered 404 not found.

Although this is not Magento's way of finding the appropriate file, from where the CSS file is being called, I hope it will help you find the file faster.

  1. Open a file editor like sublime text, notepad++ or any other of your choice.
  2. Do a search for the CSS file name within folders. Below are the shortcuts to search within a folder for some of the popular editors:

Sublime Text: Press CTRL + SHIFT + F.

Notepad++: Press CTRL + SHIFT + F.

Geany: Press CTRL + SHIFT + F.

For other editors, you can check their respective documentation.

  1. After searching for the file where your desired CSS file has been called, you can easily comment/remove the line to avoid inclusion of the file.
0

Please have a look on page.xml of your theme:

default\layout\page.xml

you can see under

<block type="page/html_head" name="head" as="head">

Something like this:

<action method="addCss"><stylesheet>css/styles.css</stylesheet></action>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.