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:

<IfModule mod_rewrite.c>
    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:

<VirtualHost *:80>
        ServerAdmin [email protected]
    ServerName servername.com
    ServerAlias www.servername.com
        DocumentRoot /var/www/servername.com/public_html/web/

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

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

        <IfModule mod_dir.c>
            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.


1 Answer 1


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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