TransWikia.com

Craft CMS Shows 404 Error on Admin Pages

Craft CMS Asked by dpayne on September 4, 2021

I’m trying to take a live / currently well functioning production site and create a local version. I downloaded all the files and the database and the site itself now works on my local device but whenever I try to access any of the admin pages to edit the site, I get a 404 page from Craft.

I replaced my entire craft/app folder to help ensure no corrupt file issues and that didn’t fix the problem. I also completely deleted the contents of my craft/storage/runtime folder to account for the potential download of temp files that could be confusing the local site and that didn’t fix it either.

The local site is running in dev mode and there is no error that shows on any of the admin pages, just a 404.

Any idea what’s going on here and possible fixes?

Thanks!

2 Answers

Goodness, I figured out what was going on here. The cpTrigger had been changed from admin to a different name in the craft/config/general file. [Facepalm]

Correct answer by dpayne on September 4, 2021

I am Ubuntu user so my solution will work well on Ubuntu and with apache not nginx I faced this issue so I did those steps which may help you:

  1. sudo a2enmod rewrite
  2. sudo service apache2 restart
  3. sudo nano /etc/apache2/sites-enabled/000-default.conf

inside it i put this block of configuration to tell apache that on port 80 I have server named with 'myserver.test' and the php code to be executed will be inside /var/www/html/craft/web

<VirtualHost *:80>
    
      ServerName myserver.test
      DocumentRoot /var/www/html/craft/web
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

where /var/www/html/craft/web was my path to 'web' folder inside 'craft' folder I created

And 'myserver.test' was my a local domain to allow me login to dashboard

  1. sudo service apache2 restart
  2. sudo nano /etc/hosts

then adding this line

127.0.0.1       myserver.test
  1. sudo nano /etc/apache2/apache2.conf
<Directory /var/www/html/craft>

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

where /var/www/html/craft is the path to the folder which I want the rewrite mod to work inside

  1. sudo service apache2 restart

at the end everything worked fine with me at http://myserver.test/.

Answered by Poode on September 4, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP