Magento – Magento 2 Installation Issue: 404 error while trying to load admin page

404-pagemagento2

I have successfully installed Magento 2 on the wamp server but I'm having a slight issue of loading the admin page as it is giving me a 404. Also, when loading its homepage the default theme that is luma in my case doesn't apply and instead gives me the following errors:

Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1/test1/pub/static/frontend/Magento/luma/en_US/mage/calendar.css     
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1/test1/pub/static/frontend/Magento/luma/en_US/css/styles-m.css 
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1/test1/pub/static/frontend/Magento/luma/en_US/css/styles-l.css 
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1/test1/pub/static/frontend/Magento/luma/en_US/css/print.css 
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1/test1/pub/static/frontend/Magento/luma/en_US/images/logo.svg    
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1/test1/pub/static/frontend/Magento/luma/en_US/css/styles-m.css 
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1/test1/pub/static/frontend/Magento/luma/en_US/css/styles-l.css 
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1/test1/pub/static/frontend/Magento/luma/en_US/requirejs/require.js 
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1/test1/pub/static/frontend/Magento/luma/en_US/css/print.css     
Failed to load resource: the server responded with a status of 404 (Not Found)
http://127.0.0.1/test1/pub/static/frontend/Magento/luma/en_US/mage/requirejs/mixins.js 
Failed to load resource: the server responded with a status of 404 (Not Found)
requirejs-config.js:602 Uncaught ReferenceError: require is not defined
127.0.0.1/:24 Uncaught ReferenceError: require is not defined
127.0.0.1/:26 Uncaught ReferenceError: require is not defined

Best Answer

Css and js will created at run time in pub/static folder In first time,if css and js missing then run below command

if you are using windows: php bin\magento setup:static-content:deploy

if using linux of 'git bash': php bin/magento setup:static-content:deploy

Related Topic