I have a Wildcard SSL certificate and yesterday I have asked to siteground to extend it to all my subdomains, the result is that today any https url throw the 404 error (except for index.php/homepage).

Is it a problem of configuration or a bad installation of the certificate?

  • I have tried to do not use the https and everything works fine
  • I have just changed the config under System>General>Web>Secure and then cleaned up sessions, cache and memcache, restored file permission and reindexed the information, but with no luck.

    This is my .htaccess in my magento folder:

    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php
    DirectoryIndex index.php
    <IfModule mod_php5.c>
    php_value memory_limit 256M
    php_value max_execution_time 18000
    php_flag magic_quotes_gpc off
    php_flag session.auto_start off
    #php_flag zlib.output_compression on
    php_flag suhosin.session.cryptua off
    php_flag zend.ze1_compatibility_mode Off
    <IfModule mod_security.c>
    SecFilterEngine Off
    SecFilterScanPOST Off
    <IfModule mod_deflate.c>
    <IfModule mod_ssl.c>
    SSLOptions StdEnvVars
    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^api/rest api.php?type=rest [QSA,L]
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
    RewriteRule .* - [L,R=405]
    <IfModule mod_setenvif.c>
    <IfModule mod_headers.c>
        Header set X-Content-Type-Options: nosniff
        BrowserMatch \bMSIE\s8 ie8
        Header set X-XSS-Protection: "1; mode=block" env=!ie8
    #RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.*$
    #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
    #RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-l
    RewriteRule .* index.php [L]
    AddDefaultCharset Off
    #AddDefaultCharset UTF-8
    <IfModule mod_expires.c>
    ExpiresDefault "access plus 1 year"
    Order allow,deny
    Allow from all
    <Files RELEASE_NOTES.txt>
        order allow,deny
        deny from all
    #FileETag none
    <Files cron.php>
        #AuthName "Cron auth"
        #AuthUserFile ../.htpasswd
        #AuthType basic
        #Require valid-user
        Order allow,deny
        Deny from all


  • I'm using magento
  • Admin area works fine

    EDIT 2
    Setting: settings
  • first tell us which magento version you are using? Commented Dec 10, 2016 at 16:34
  • @MurtuzaZabuawala Oops, sorry, I have just added it, it is
    – Razorphyn
    Commented Dec 10, 2016 at 17:00
  • did you end up finding a solution @Razorphyn? I'm testing out switching to full https, and am encountering the same issue. Home page and admin works via https, but all other pages return 404. Commented Apr 28, 2017 at 13:28
  • @ZekeFarwell unfortunately not, I am not able to control those param, since I am on a shared hosting, I am just able to use the main domain in ssl, which the edit of .htaccess has solved, but the subdomain are not usable through ssl...
    – Razorphyn
    Commented Apr 28, 2017 at 20:20

2 Answers 2


I encountered this same issue while testing out a switch to full https. Home page and admin pages worked fine via https, but all other pages gave a 404.

In my case the root cause was an error in my Apache configuration. Since Apache listens on a separate port for https:// (443 rather than 80) it also has a separate virtual host. On my Ubuntu server the config files were at these paths:

/etc/apache2/sites-available/000-default.conf (port 80)
/etc/apache2/sites-available/default-ssl.conf (port 443)

While the 000-default.conf file had an AllowOverride All declaration as shown below, this was missing from the default-ssl.conf.

<VirtualHost *:80>

  <Directory "/var/www/html">
    AllowOverride All


After adding the directory node and AllowOverride All to the port 443 virtual host in default-ssl.conf, the 404 errors went away. I believe the issue was that Magento relies on the .htaccess file for url rewrites to work on the front end, and Apache only parses .htaccess files when the AllowOverride All declaration is present. Therefore url rewrites didn't work, thus the 404s. Home page doesn't need a rewrite so it worked, and the admin doesn't use rewrites so it worked fine too.

  • Awesome! This is what I missed also (i.e. AllowOverride All) why SSL on my Magento 2 setup doesn't work. Cheers!
    – phagento
    Commented Nov 6, 2018 at 6:20

Partially solved:

## you can put here your magento root folder
## path relative to web root

    RewriteBase /shop/

It works for te main domain, but ot for the subdomain...

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.