magento 2 admin url not working and loaded frontend is all messy

Admin url is showing 404 error after installing magento 2 on wamp server and frontend design is all messy and css is not linked to it.Error visuals are shown below.

Frontend error:

enter image description here

Solutions

For those who are using wamp server on windows localhost then,

you can try this:

C:\wamp\bin\php\php5.5.12>php.exe C:\wamp\www\<Magento root directory>\bin\magento setup:static-content:deploy

in your CLI.

First of all, apply proper permissions, enable apache rewrite_module and refresh apache server.

chmod -R 777 /var/www/html/MAGENTO_2_ROOT_DIRECTORY/

sudo a2enmod rewrite

sudo service apache2 restart

For messy frontend, run following command from Magento root:

php bin/magento setup:static-content:deploy

Now clear var directory except .htaccess file and check admin. If you get 404 page, there may be an issue of Symlink. Fot this, Edit apache config file

sudo gedit /etc/apache2/apache2.conf

and replace this code :

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride none
Require all granted

with

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted

Note: changed AllowOverride none to AllowOverride All

Now restart apache sudo service apache2 restart and check admin. This should fix admin 404 issue.

Also make sure, you don't leave /app/etc/ directory writeable

Make sure you enabled server rewrites: http://devdocs.magento.com/guides/v2.0/install-gde/prereq/apache.html#apache-help-rewrite

Tags: Admin / Magento 2.x / Css

Similar questions

Magento 2 custom Theme no css and products loaded in frontend
I created a new Template based on the Blanco/Luma theme as pointed out in several howto's as in this topic) Strange thing is that the css and the products (and images) which are available do not load in frontend. So I end up with just plain text. I tried all solutions mentioned like deleting the static files, running php bin/magento setup:static-co...
Loaded image showing broken image symbol on backend and frontend
When I load a new image to product or page I get a broken image symbol on backend and frontend. Previous loaded images in the storage root are able to load fine. New images add to storage root look fine in storage root file but when uploaded the same broken image symbol. Same happening on all 3 magento sites. Loaded images are going in the media fo...
Magento2.3.0 :When merge and minify js and css after set production mode not working my admin panel and frontend css lacking
I am using Magento2.3.0 community version When merge and minify js and css after set production mode not working my admin panel and front end css lacking if any one know what is actual issue reply me .I apply all command in our production side.
Magento 2.3.1 styles.css not loaded on frontend
I just installed a fresh Magento 2.3.1, and I ran the following code to deploy sampledata. bin/magento sampledata:deploy The sample data are successfully installed but styles.css is not loading. I have checked pub/media folder, and I can see the styles.css does exist. I tried the following step to fix the problem bin/magento setup:upgrade , bin/mag...
Rewrite not working CSS not loaded, module enabled
CSS, scripts not loading, via pub/static/version1496086766/frontend/Magento/, but loading without version: pub/static/frontend/Magento/.. There is .htaccess file with rewrite rule, and sudo a2enmod rewrite - Module rewrite already enabled, and I have set AllowOverride: SSLOptions +StdEnvVars AllowOverride All I have set up apache virtual host with ...
I changed the admin URL path and I need to change it back, but I no longer have access to the admin panel, because I changed the admin URL. :(
I changed the admin URL path and I need to change it back, but I no longer have access to the admin panel, because I changed the admin URL. :( I forget exactly what the input form looked like, so I'm not sure exactly what I did, but as soon as I hit "save" I lost my access to the admin panel. How can I get into the admin panel?

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy.