<p>In my case, my url routing wasn't functional because the <code>mod_rewrite</code> module in Apache was disabled. I enabled it with <code>a2enmod</code>, restarted Apache, and my problem was solved.</p>

CC BY-SA 4.0
2020-06-07T01:06:52.430Z
2020-06-07T01:06:52.430Z
jkofskie
<p>I am deploying a Craft site, I have it installed and everything is working fine, but whenever I try to access the admin panel I get a generic 404. I have tried every solution offered in similar questions, none of them work.
Here's my <code>.htaccess</code> file:</p>

<pre><code>&lt;IfModule mod_rewrite.c&gt;
    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
&lt;/IfModule&gt;
</code></pre>

<p>And my Apache Virtual Host file:</p>

<pre><code>&lt;VirtualHost *:80&gt;
        ServerAdmin info@servername.com
    ServerName servername.com
    ServerAlias www.servername.com
        DocumentRoot /var/www/servername.com/public_html/web/

        &lt;Directory /var/www/servername.com/&gt;
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        &lt;/Directory&gt;

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

        &lt;IfModule mod_dir.c&gt;
            DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
        &lt;/IfModule&gt;

&lt;/VirtualHost&gt;
</code></pre>

<p>Making the url hostname/index.php/admin does work, however.
Any suggestions would be much appreciated, or if more information is required please let me know.</p>

<craft3><apache>
Admin and Dashboard showing 404
# Admin and Dashboard showing 404

(Asked by: username_0 on 2020-06-01)

I am deploying a Craft site, I have it installed and everything is working fine, but whenever I try to access the admin panel I get a generic 404. I have tried every solution offered in similar questions, none of them work.
Here's my .htaccess file:

    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]


And my Apache Virtual Host file:

        ServerAdmin info@servername.com
    ServerName servername.com
    ServerAlias www.servername.com
        DocumentRoot /var/www/servername.com/public_html/web/

        
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        

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

        
            DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
        



Making the url hostname/index.php/admin does work, however.
Any suggestions would be much appreciated, or if more information is required please let me know.

**Tags:** craft3, apache


---

## 1 answers

### Answer by username_0 on 2020-06-07. Score: 2 | Accepted answer

In my case, my url routing wasn't functional because the `mod_rewrite` module in Apache was disabled. I enabled it with `a2enmod`, restarted Apache, and my problem was solved.


---

