5

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!

  • Is it a Craft-styled 404 page? Did you also download the .htaccess file in the public HTML folder? – Brad Bell Oct 29 '15 at 16:42
  • The 404 has the same formatting as the 404 page from our prod site so it is not an Apache 404 at least. The .htaccess file does exist in the public folder. I've tried both the version from the prod site and the original version that comes with the Craft install and it gives the same result. – dpayne Oct 29 '15 at 17:07
  • What if you go to yourdomain.com/index.php?p=admin? – Brad Bell Oct 29 '15 at 17:44
  • I still get the 404 page. – dpayne Oct 29 '15 at 17:56
  • One other note on the 404 page that I just noticed. When I remove the .htaccess from my /public folder, and I attempt to access any non-admin page URL, I get an apache 404. However, accessing any admin page serves a non-apache 404 (the same one as from the prod site). Hope that is helpful background. – dpayne Oct 30 '15 at 23:06
4

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]

| improve this answer | |
  • I'm having this problem, but cpTrigger is set to admin, as it should be. – BBaysinger Mar 7 '19 at 17:05
  • @BBaysinger, I was in the same boat. I posted my solution on this issue – Andrea Hall Mar 8 '19 at 15:59
1

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 my 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/.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.