1

I have one request that is I need to change all the css & js path from absolute to relative in page source.

Please refer the screenshot for your easy reference. here I want to change all the css ans js to relative path.

screenshot for your easy reference

For example I need to change

<link  rel="stylesheet" type="text/css"  media="all" href="http://172.17.0.2/pub/static/frontend/Gworks/Home/en_US/mage/calendar.css" />

To

<link  rel="stylesheet" type="text/css"  media="all" href="/pub/static/frontend/Gworks/Home/en_US/mage/calendar.css" />

how to achieve this?

note : Suppose if this not best practice or not possible, please mention the valid reason in your answers.

3
  • is this in your theme layout or module? Commented Sep 14, 2016 at 13:19
  • @belfort1 I am asking generally, when u see your magento-2 source code (CTRL+U), all the css and js declare with full absolute path I need to change that to relative path. Still you can't get please feel free to mention in comment I will update again. Commented Sep 14, 2016 at 13:23
  • ok, had misunderstood your question, the urls for css are processed in: Magento\Framework\View\Url\CssResolver Commented Sep 14, 2016 at 13:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.