cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 - Localhost - Admin url returning 404

Magento 2 - Localhost - Admin url returning 404

The installation was successful. I chose the administrative address / admin
http://92.222.70.161/magento2/admin

Home working properly, and the site administration does not:

 

Not Found

The requested URL /magento2/admin was not found on this server.

Apache/2.4.18 (Ubuntu) Server at 92.222.70.161 Port 443
magento info:adminuri

Admin URI: /admin

How can I fix this?

18 REPLIES 18

Re: Magento 2 - Localhost - Admin url returning 404

Edit apache2.conf file and change following

 

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

to

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>
---
Problem Solved Click Accept as Solution!:Magento Community India Forum

Re: Magento 2 - Localhost - Admin url returning 404

Thank you for help.
The issue still exists.

 

 

File: /etc/apache2/sites-available/000-default.conf

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.
        #ServerName www.example.com

        ServerAdmin webmaster@posmaster.com
        DocumentRoot /var/www/html

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

        # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
        # error, crit, alert, emerg.
        # It is also possible to configure the loglevel for particular
        # modules, e.g.
        #LogLevel info ssl:warn

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        # For most configuration files from conf-available/, which are
        # enabled or disabled at a global level, it is possible to
        # include a line for only one particular virtual host. For example the
        # following line enables the CGI configuration for this host only
        # after it has been globally disabled with "a2disconf".
        #Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Re: Magento 2 - Localhost - Admin url returning 404

Hi @MAXIS2016,

 


Have you tried to access the admin using this URL?

http://92.222.70.161/magento2/index.php/admin

 

 

Best regards.

Gabriel

Welcome to the Magento Forums. Remember to introduce yourself and read the Magento Forums Guidelines.

Re: Magento 2 - Localhost - Admin url returning 404

https://community.magento.com/t5/Technical-Issues/The-requested-URL-magento-was-not-found-on-this-se...

 

i have same problem too. But i have directry not text in apache conf

Re: Magento 2 - Localhost - Admin url returning 404

I'm running Magento2 on an Ubuntu 16.04 setup. Localhost gives me the Apache2 "it works!" page. Admin URI (obtaiined by bin/magento info:adminuri) returns "/", i.e. the magento2 directory. I have changed the apache2.conf file as above in this thread. I have also adapted my ,htaccess in magento2 by uncommenting

#RewriteBase /magento/

Pointing my browser at http://localhost/magento2/index.php/admin gives me a blank page (no 404 error).

 

Is there anything else I can do to access the admin panel?

Re: Magento 2 - Localhost - Admin url returning 404

I'm getting the same error on fresh updated new install Ubuntu 16.04 & Magento 2.2

http://localhost/admin

http://hostname/admin

home page comes up with only HTML text and no style sheet applied.

using localhost, 127.0.0.1 & hostname produce the same. It does convert localhost and the loopback address to the actual hostname of the server.

 

I added the edits above to apache2.conf and also to 000-default.conf and restarted apache2.

I even rebooted.

I also tried the url example above: http://hostname/index.php/admin I left out the magento2 because I installed in the root of var/www/html

That is the only thing that produced a clue: Instead of just a 404 error, I got a 404 error and the below message.

"The requested URL /admin/admin/index/index/key/6a3224ae336a7a45b67c466b8cdb198a9a2cfbe75f25b41116d08ddc4e4bb507/ was not found on this server."

 

Please help

Re: Magento 2 - Localhost - Admin url returning 404

I'm also getting the same error on fresh updated new install Ubuntu 16.05 & Magento 2.3

http://localhost/admin

http://hostname/admin

home page comes up with only HTML text and no style sheet applied.

using localhost, 127.0.0.1 & hostname produce the same. It does convert localhost and the loopback address to the actual hostname of the server.

Please let me know how to resolve that problem.

Re: Magento 2 - Localhost - Admin url returning 404

Same here, guys!

 

Apache 2.4, Ubuntu 16.04, Magento 2.0.2

 

After the installation had issues with CSS, deployed static resources

bin/magento setup:static-content:deploy

and allowed override for var/www directory in apache2.conf.

 

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

Still cannot access the admin

 

UPDATE: Okay, after a while it worked...

Re: Magento 2 - Localhost - Admin url returning 404

I found this to be an issue with my env.php file it had the entire system config settings within it including the base url.

I removed the system array and then ran php bin/magento setup:upgrade --keep-generated.


Now it works I can go into further into the answer then but wanted to write something quick since i just figured it out.