I did a fresh install it went successful after a lot of tries.
Both front-end and admin wont load CSS/JS/ files are not created in pub/static directory & as one directory _requireJs
Also frontend and adminhtml directories do not exist in pub/static.
For further info, i was installing it with sample data.
Is Apache mode_rewrite enabled and its configuration is allowed from .htaccess files of your web-site?
@buskamuza .htaccess was not allowed. I allowed .htacess and magento showed up the theme.
Could you put some light on this behavior of magento?
Thanks for the help. :)
More documentation about this behavior here
Additionally to the big documentation @mazhalai pointed to, here is how static view files are related to mod_rewrite.
pub/static/.htaccess discovers it and redirects to pub/static.phppub/static.php searches for the requested file using fallback mechanism described in the article mentioned by @mazhalai pub/static/ folder (e.g., pub/static/frontend/Magento/blank/css/file.css)mod_rewriteThis is default behavior (when default application mode is used).
In developer mode the file is not even published to pub/static folder. It goes through pub/static.php entry point every time.
In production mode it's expected that all files are published to pub/static folder, so pub/static.php should not be involved at all. If it is, it just returns 404 error. There is a tool for deploying static view files and it should be used to make production mode work (dev/tools/Magento/Tools/View/deploy.php)
We're thinking how UX can be improved in this area, but right now it works as described above.
@mrugeshrocks, are there other questions remaining that you'd like to ask related to your original question?
Thanks @buskamuza & @mazhalai
With this im closing the issue.
Just as a side note…
I had to add RewriteBase /pub/static/ when using a VirtualDocumentRoot.
Hi @mrugeshrocks. Thank you for your report.
The issue has been fixed in magento/graphql-ce#973 by @VitaliyBoyko in 2.3-develop branch
Related commit(s):
The fix will be available with the upcoming 2.3.4 release.
Hi @mrugeshrocks. Thank you for your report.
The issue has been fixed in magento/magento2#28366 by @Nazar65 in 2.4-develop branch
Related commit(s):
The fix will be available with the upcoming 2.4.1 release.
Most helpful comment
Additionally to the big documentation @mazhalai pointed to, here is how static view files are related to
mod_rewrite.pub/static/.htaccessdiscovers it and redirects topub/static.phppub/static.phpsearches for the requested file using fallback mechanism described in the article mentioned by @mazhalaipub/static/folder (e.g.,pub/static/frontend/Magento/blank/css/file.css)mod_rewriteThis is default behavior (when
defaultapplication mode is used).In
developermode the file is not even published topub/staticfolder. It goes throughpub/static.phpentry point every time.In
productionmode it's expected that all files are published topub/staticfolder, sopub/static.phpshould not be involved at all. If it is, it just returns 404 error. There is a tool for deploying static view files and it should be used to makeproductionmode work (dev/tools/Magento/Tools/View/deploy.php)We're thinking how UX can be improved in this area, but right now it works as described above.