<p>I am Ubuntu user so my solution will work well on <strong>Ubuntu</strong> and with <strong>apache</strong> not nginx
I faced this issue so I did those steps which may help you:</p>
<ol>
<li>sudo a2enmod rewrite</li>
<li>sudo service apache2 restart</li>
<li>sudo nano /etc/apache2/sites-enabled/000-default.conf</li>
</ol>
<p>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</p>
<pre><code>&lt;VirtualHost *:80&gt;
</code></pre>
<pre><code>    
      ServerName myserver.test
      DocumentRoot /var/www/html/craft/web
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined
</code></pre>
<pre><code>&lt;/VirtualHost&gt;
</code></pre>
<p>where /var/www/html/craft/web was my path to 'web' folder inside 'craft' folder
I created</p>
<p>And 'myserver.test' was my a local domain to allow me login to dashboard</p>
<ol start="4">
<li>sudo service apache2 restart</li>
<li>sudo nano /etc/hosts</li>
</ol>
<p>then adding this line</p>
<pre><code>127.0.0.1       myserver.test
</code></pre>
<ol start="6">
<li>sudo nano /etc/apache2/apache2.conf</li>
</ol>
<pre><code>&lt;Directory /var/www/html/craft&gt;
</code></pre>
<pre><code>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</code></pre>
<pre><code>&lt;/Directory&gt;
</code></pre>
<p>where /var/www/html/craft is the path to the folder which I want the rewrite mod to work inside</p>
<ol start="7">
<li>sudo service apache2 restart</li>
</ol>
<p>at the end everything worked fine with me at <a href="http://myserver.test/" rel="nofollow noreferrer">http://myserver.test/</a>.</p>

CC BY-SA 4.0
2020-07-20T19:01:01.313Z
2021-02-17T23:23:45.697Z
2021-02-17T23:23:45.697Z
Poode
<p>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]</p>

CC BY-SA 4.0
2019-03-07T17:05:02.073Z
I'm having this problem, but `cpTrigger` is set to `admin`, as it should be.
BBaysinger
CC BY-SA 4.0
2019-03-08T15:59:53.383Z
@BBaysinger, I was in the same boat. I posted my solution on [this issue](https://craftcms.stackexchange.com/questions/28641/craft-cms-3-admin-panel-returns-404-with-ssl/29761#29761)
Andrea Hall
CC BY-SA 3.0
2015-10-30T23:43:15.363Z
2015-10-30T23:43:15.363Z
dpayne
<p>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. </p>

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

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

<p>Any idea what's going on here and possible fixes?</p>

<p>Thanks!</p>

CC BY-SA 3.0
2015-10-29T16:42:22.567Z
Is it a Craft-styled 404 page? Did you also download the `.htaccess` file in the public HTML folder?
Brad Bell
CC BY-SA 3.0
2015-10-29T17:07:42.053Z
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
CC BY-SA 3.0
2015-10-29T17:44:21.353Z
What if you go to `yourdomain.com/index.php?p=admin`?
Brad Bell
CC BY-SA 3.0
2015-10-29T17:56:19.487Z
I still get the 404 page.
dpayne
CC BY-SA 3.0
2015-10-30T23:06:58.420Z
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
<installation>
Craft CMS Shows 404 Error on Admin Pages
# Craft CMS Shows 404 Error on Admin Pages

(Asked by: username_0 on 2015-10-29)

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!

**Tags:** installation

> **Comments:**
> **username_1**: Is it a Craft-styled 404 page? Did you also download the `.htaccess` file in the public HTML folder?  
> **username_0**: 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.  
> **username_1**: What if you go to `yourdomain.com/index.php?p=admin`?  
> **username_0**: I still get the 404 page.  
> **username_0**: 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.  

---

## 2 answers

### Answer by username_0 on 2015-10-30. Score: 4 | Accepted answer

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]

> **Comments:**
> **username_3**: I'm having this problem, but `cpTrigger` is set to `admin`, as it should be.  
> **username_4**: @username_3, I was in the same boat. I posted my solution on [this issue](https://craftcms.stackexchange.com/questions/28641/craft-cms-3-admin-panel-returns-404-with-ssl/29761#29761)  

---

### Answer by username_2 on 2020-07-20. Score: 2

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:

sudo a2enmod rewrite
sudo service apache2 restart
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


    
      ServerName myserver.test
      DocumentRoot /var/www/html/craft/web
      ErrorLog ${APACHE_LOG_DIR}/error.log
      CustomLog ${APACHE_LOG_DIR}/access.log combined



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

sudo service apache2 restart
sudo nano /etc/hosts

then adding this line
127.0.0.1       myserver.test


sudo nano /etc/apache2/apache2.conf




        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted



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

sudo service apache2 restart

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


---

