Search code examples
phpstorm

Phpstorm unable to resolve css paths for aliased directories


I'm working with a web platform that has the /images directory aliased in its Apache config. How can I let PhpStorm know about this alias so that it stops marking stylesheets as erroneous? The real path to these images would be something more like /content/images/vt/facebook.png.

enter image description here


Solution

  • You can try marking /content folder as 'Resource root' (Mark Directory As/Resource root) - folders marked this way are treated as root folders, so that 'absolute' URLs (with leading slash) are resolved relative to them. Note that you need to reopen the project after making this change