3

I know there are many answers for this i tried all and not able to do it on my server hosted with godaddy magento latest version

I tried this

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

404 not found error for admin page

didn't work out

then

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy

rm -rf var/cache/*

rm -rf var/generation/*

this dint work out

added httaccess to my root directory

https://github.com/emizentech/magento2/blob/master/.htaccess.sample

though it was not there still dint work out home page works fine as expected with no erros on it

but admin page says 404 error

domain.com/admin

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

Apache/2.4.18 (Ubuntu) Server at 192.169.143.135 Port 80

If I added domain.com/index.php/admin

Not Found
The requested URL /admin/admin/index/index/key/be1e5947f83b71x354749eds3ba0aa7321a8a8d659aca49cc8a00fb4de1cc57ab956f/ was not found on this server.

Apache/2.4.18 (Ubuntu) Server at 192.169.143.135 Port 80

I enabled developer mode to

 main.DEBUG: cache_invalidate:  {"method":"GET","url":"http://192.169.143.135/index.php/admin/","invalidateInfo":{"tags":["interception","CONFIG"],"mode":"matchingTag"}} []

enter image description here

Teja Bhagavan Kollepara
  • 3,816
  • 5
  • 32
  • 69
Shaik
  • 181
  • 1
  • 1
  • 7

4 Answers4

5

Please try Below steps

  • Delete var/cache folder
  • Go to database SELECT * FROM core_config_data WHERE path = 'web/seo/use_rewrites' and make it 0
  • Then enter url in your browser magento_base_url/index.php/your_admin_url

try and let me know if you face any issue.

Rohan Hapani
  • 17,388
  • 9
  • 54
  • 96
5

Fileally After Rebuilding Server again

installing php 7.1 mysql marine

apache2

got the solution

Source : After successful installation, admin URL is returning a 404?

I was also facing the same problem. My frontend's css is not loading as well as admin panel was giving 404 error page. The solution of both the problem in ubuntu is enable Apache server rewrites:

  1. Go to your terminal and run this command:

    sudo gedit /etc/apache2/apache2.conf

    And change:

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

    To

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

    change only AllowOverride none to All

  2. Go to your terminal and run command:

    sudo a2enmod rewrite

    sudo service apache2 restart

  3. Then give the permission to your var, pub and app/etc. and then go to your admin and frontend it works properly.

Shaik
  • 181
  • 1
  • 1
  • 7
1

Change Admin Path and try again:

It is not recommended to change it directly from app/etc/env.php, always prefer the CLI:

php bin/magento setup:config:set --backend-frontname="admin_url"
Nikunj Vadariya
  • 4,037
  • 1
  • 20
  • 30
0

In my case, I had accidentally set a store as the default in the control panel:

enter image description here

In core_config_data:

layout_switcher/general/default_theme was set to 'interiors'

Whenever I tried to access the admin area, I got the template for interiors and a 404. To fix I set:

layout_switcher/general/default_theme back to 'base'

I then ran:

php bin/magento cache:clean
php bin/magento cache:flush
Onshop
  • 111
  • 2