I'm getting the wrong media, JS & CSS file path on the frontend and backend after installing Magento 2.4.2. Please review the below URLs we are getting. I've tried updating the value in the database core_config_data table, Also in-store configuration values.

enter image description here

  • Hi! Which part of the URL is invalid? Could you post full url path with example.com as domain mask?
    – dudzio
    May 30, 2021 at 18:39
  • Yes, Suppose the require js file url which I'm getting on frontend. example.com/static/frontend/Magento/luma/en_US/requirejs/… May 30, 2021 at 18:43
  • What is your expected URL?
    – dudzio
    May 30, 2021 at 18:50
  • It should also include in baseURL/pub/static/..... currently it is not showing the pub folder before static folder May 30, 2021 at 18:59
  • But could add to your question both URLs: correct one and current one? It definitely shouldn't have pub directory inside URL, because MAGE_ROOT/pub should be your default root location in vhost config file (root $MAGE_ROOT/pub; if you use nginx).
    – dudzio
    May 30, 2021 at 19:04

1 Answer 1


You need to put url in core_config like "https://example.com/pub/static/"

it will help you

  • 1
    It will work, but pub should never be in path on correctly configured Magento instance.
    – dudzio
    May 31, 2021 at 7:18
  • then please remove value from that field. make it empty it will help you. dont forget to clear cache after that May 31, 2021 at 7:23
  • Yes it was cache related error. it fixed automatically after cache was disabled Jun 1, 2021 at 13:06

Your Answer

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

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