1

I purchased a Standard UCC SSL Up to 100 pack from Godaddy. I have installed all the required files on my server, and going to https://www.example.com works fine, but http://www.example.com is NOT forwarding to https:// version ... on SOME browsers. Why is that?

This site is a virtual host on a Ubuntu Linux machine running Apache latest version.

My configuration is below:

   <VirtualHost *:80>
     ServerName example.com
     ServerAlias  www.example.com
     UseCanonicalName Off
     DocumentRoot /var/www/vhosts/example.com/httpdocs
     Redirect permanent / https://www.example.com/
   </VirtualHost>

    <VirtualHost _default_:443>

       ServerName   example.com
       ServerAlias  www.example.com
       UseCanonicalName Off
       DocumentRoot /var/www/vhosts/example.com/httpdocs
       ErrorLog ${APACHE_LOG_DIR}/example.com-error.log

       # Possible values include: debug, info, notice, warn, error, crit,
       # alert, emerg.
       LogLevel warn

       CustomLog ${APACHE_LOG_DIR}/example-access.log combined

       SSLEngine on
       SSLCertificateFile /etc/apache2/ssl-all/example.com/example.crt
       SSLCertificateKeyFile /etc/apache2/ssl-all/example.com/example.key
       SSLCertificateChainFile /etc/apache2/ssl-all/example.com/gd_bundle-g2-g1.crt

    <Directory /var/www/vhosts/example.com/httpdocs>

           Options Indexes FollowSymLinks MultiViews
           AllowOverride FileInfo Options
           Order allow,deny
           allow from all

            <IfModule mod_php5.c>
                    php_admin_flag engine on
             </IfModule>

             # BEGIN WordPress
              <IfModule mod_rewrite.c>
              RewriteEngine On
              RewriteBase /
              RewriteRule ^index\.php$ - [L]
              RewriteCond %{REQUEST_FILENAME} !-f
              RewriteCond %{REQUEST_FILENAME} !-d
              RewriteRule . /index.php [L]
              </IfModule>

              # END WordPress
   </Directory>

  </VirtualHost>

Also tried replacing that Redirect with the below with no luck:

 RewriteEngine On
 RewriteCond %{SERVER_PORT} !443
 RewriteRule ^(/(.*))?$ https://%{HTTP_HOST}/$1 [R=301,L]

And:

 RewriteEngine On
 RewriteCond %{HTTPS} off
 RewriteRule (.*) https://www.example.com/%{REQUEST_URI} [R=301,L]

Thing is going to http://www.example.com forwards correctly in Chrome, but NOT in Firefox ... I've cleared cache on both browsers, rebooted my server, reloaded apache, restarted both browsers.

Same thing with my clients, if they go directly to https://www.example.com works fine ... if they go to http:// version it just will not forward.

Any ideas on what else I could try to get this working across the board? I thought it was caching issue, but it has been over 48 hours now, and I've cleared cache so many times I can't count.

Alex Douglas
  • 323
  • 1
  • 4
  • 11
  • http://serverfault.com/questions/753921/apache-two-redirect-conditions-in-one-redirect-rule/753922#753922 – user9517 Feb 04 '16 at 20:14
  • yeah I saw this one as well, tried that one with no luck ... just replace my redirect with the one above – Alex Douglas Feb 04 '16 at 20:18
  • Curl -I http://www.example.com and post your output. Or use redirect checker – Jacob Evans Feb 05 '16 at 05:05
  • Are you using .htaccess? Try setting `AllowOverride None` in your `` container. But the fact that it works in one browser and not the other is sceptical and still suggests a caching issue, unless perhaps the (desired) response you are seeing Chrome is a cached response?! Check for the `Location:` header in the response. This is, after all, what the `Redirect` (mod_alias) and `RewriteRule` (mod_rewrite) directives should be setting. Note that mod_rewrite probably executes first so will override any `Redirect` directives. – MrWhite Feb 05 '16 at 23:59

0 Answers0