Moved from http to https but include www in urlHow to make https URL to httpURL Rewrite Throws a 301 Redirect When It Shouldn'tRedirecting HTTP to HTTPS?Force api connect HTTP not HTTPSHttp version redirected to https but appeared as 200 OKHTTPS 301 redirecting to http versionHttp to https 301 redirectMagento 1.9.3.8 Full https causes double / ending.htaccess redirect samplesitex.com to samplesitey/alias-page in both https and http variantsRedirect one https url to http

Keeping an "hot eyeball planet" wet

Why is my read in of data taking so long?

TSA asking to see cell phone

Why are there not any MRI machines available in Interstellar?

Why does Mark say he hasn't had a shower for a year and a half?

What is the difference between 1/3, 1/2, and full casters?

Inadvertently nuked my disk permission structure - why?

Replacing tongue and groove floorboards: but can't find a match

Iterate over non-const variables in C++

How do I generate distribution of positive numbers only with min, max and mean?

Why is a dedicated QA team member necessary?

Terence Tao–type books in other fields?

Why are off grid solar setups only 12, 24, 48 VDC?

Which Roman general was killed by his own soldiers for not letting them to loot a newly conquered city?

kids pooling money for Lego League and taxes

Memory capability and powers of 2

Why can't my huge trees be chopped down?

What exactly makes a General Products hull nearly indestructible?

Using "Kollege" as "university friend"?

How important is a good quality camera for good photography?

Grid/table with lots of buttons

Is it better to memorize verb's 1st person perfect tense?

expansion with *.txt in the shell doesn't work if no .txt file exists

Time travel novel: machine makes clones, clones battle to be the one to get back their life



Moved from http to https but include www in url


How to make https URL to httpURL Rewrite Throws a 301 Redirect When It Shouldn'tRedirecting HTTP to HTTPS?Force api connect HTTP not HTTPSHttp version redirected to https but appeared as 200 OKHTTPS 301 redirecting to http versionHttp to https 301 redirectMagento 1.9.3.8 Full https causes double / ending.htaccess redirect samplesitex.com to samplesitey/alias-page in both https and http variantsRedirect one https url to http






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Trying to setup my site so that its on HTTPS AND includes the WWW in the URL.



After a while of searching I found a few posts that helped me redirect to https:




stackoverflow.com/questions/25527671/magento-https-on-all-website-urls-redirect-to-homepage


and then to redirect to get the 'www' added in I used:




RewriteCond %HTTP_HOST !^www.
RewriteRule ^(.*)$ https://www.%HTTP_HOST%REQUEST_URI [L,R=301]


I ended up with everything working eventually! BUT here is where I think a problem lies. It may be me being niggley BUT when you check a URL now on my site (old redirect URL):



http://aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/Contact-Us.html



it redirects fine BUT then using a 301 redirect checker:



redirect-checker.org/index.php

you can clearly see that there is 2 301 redirects happening here.. I don't think that's ideal..

Initially this was happening 2-3 3 times SO as an example if I used the URL to check as:



aloe-herbal.co.uk/fitness-weight-management.html
@ www.redirect-checker.org/index.php

it would give me the following:


CONGRATULATION. Everything seems to be fine.

http://aloe-herbal.co.uk/fitness-weight-management.html
301 Moved Permanently
http://www.aloe-herbal.co.uk/fitness-weight-management.html
301 Moved Permanently
https://www.aloe-herbal.co.uk/fitness-weight-management.html
200 OK


I know it says its okay but I am concerned about the extra trip that its having to make..



So I decided top open a question. Well FIRSTLY thanks for a GREAT related questions feature. WOW gave me a fix straight away:




magento.stackexchange.com/questions/40400/magento-goes-first-the-http-then-redirects-to-https


Works like a charm now there is only 1 301 Moved Permanently listed :)



BUT again if you check: http://aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/Contact-Us.html



you can see its there 2 times again... That's what I am trying to fix/avoid..



Can any experts help with this last part?










share|improve this question




























    0















    Trying to setup my site so that its on HTTPS AND includes the WWW in the URL.



    After a while of searching I found a few posts that helped me redirect to https:




    stackoverflow.com/questions/25527671/magento-https-on-all-website-urls-redirect-to-homepage


    and then to redirect to get the 'www' added in I used:




    RewriteCond %HTTP_HOST !^www.
    RewriteRule ^(.*)$ https://www.%HTTP_HOST%REQUEST_URI [L,R=301]


    I ended up with everything working eventually! BUT here is where I think a problem lies. It may be me being niggley BUT when you check a URL now on my site (old redirect URL):



    http://aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/Contact-Us.html



    it redirects fine BUT then using a 301 redirect checker:



    redirect-checker.org/index.php

    you can clearly see that there is 2 301 redirects happening here.. I don't think that's ideal..

    Initially this was happening 2-3 3 times SO as an example if I used the URL to check as:



    aloe-herbal.co.uk/fitness-weight-management.html
    @ www.redirect-checker.org/index.php

    it would give me the following:


    CONGRATULATION. Everything seems to be fine.

    http://aloe-herbal.co.uk/fitness-weight-management.html
    301 Moved Permanently
    http://www.aloe-herbal.co.uk/fitness-weight-management.html
    301 Moved Permanently
    https://www.aloe-herbal.co.uk/fitness-weight-management.html
    200 OK


    I know it says its okay but I am concerned about the extra trip that its having to make..



    So I decided top open a question. Well FIRSTLY thanks for a GREAT related questions feature. WOW gave me a fix straight away:




    magento.stackexchange.com/questions/40400/magento-goes-first-the-http-then-redirects-to-https


    Works like a charm now there is only 1 301 Moved Permanently listed :)



    BUT again if you check: http://aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/Contact-Us.html



    you can see its there 2 times again... That's what I am trying to fix/avoid..



    Can any experts help with this last part?










    share|improve this question
























      0












      0








      0








      Trying to setup my site so that its on HTTPS AND includes the WWW in the URL.



      After a while of searching I found a few posts that helped me redirect to https:




      stackoverflow.com/questions/25527671/magento-https-on-all-website-urls-redirect-to-homepage


      and then to redirect to get the 'www' added in I used:




      RewriteCond %HTTP_HOST !^www.
      RewriteRule ^(.*)$ https://www.%HTTP_HOST%REQUEST_URI [L,R=301]


      I ended up with everything working eventually! BUT here is where I think a problem lies. It may be me being niggley BUT when you check a URL now on my site (old redirect URL):



      http://aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/Contact-Us.html



      it redirects fine BUT then using a 301 redirect checker:



      redirect-checker.org/index.php

      you can clearly see that there is 2 301 redirects happening here.. I don't think that's ideal..

      Initially this was happening 2-3 3 times SO as an example if I used the URL to check as:



      aloe-herbal.co.uk/fitness-weight-management.html
      @ www.redirect-checker.org/index.php

      it would give me the following:


      CONGRATULATION. Everything seems to be fine.

      http://aloe-herbal.co.uk/fitness-weight-management.html
      301 Moved Permanently
      http://www.aloe-herbal.co.uk/fitness-weight-management.html
      301 Moved Permanently
      https://www.aloe-herbal.co.uk/fitness-weight-management.html
      200 OK


      I know it says its okay but I am concerned about the extra trip that its having to make..



      So I decided top open a question. Well FIRSTLY thanks for a GREAT related questions feature. WOW gave me a fix straight away:




      magento.stackexchange.com/questions/40400/magento-goes-first-the-http-then-redirects-to-https


      Works like a charm now there is only 1 301 Moved Permanently listed :)



      BUT again if you check: http://aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/Contact-Us.html



      you can see its there 2 times again... That's what I am trying to fix/avoid..



      Can any experts help with this last part?










      share|improve this question














      Trying to setup my site so that its on HTTPS AND includes the WWW in the URL.



      After a while of searching I found a few posts that helped me redirect to https:




      stackoverflow.com/questions/25527671/magento-https-on-all-website-urls-redirect-to-homepage


      and then to redirect to get the 'www' added in I used:




      RewriteCond %HTTP_HOST !^www.
      RewriteRule ^(.*)$ https://www.%HTTP_HOST%REQUEST_URI [L,R=301]


      I ended up with everything working eventually! BUT here is where I think a problem lies. It may be me being niggley BUT when you check a URL now on my site (old redirect URL):



      http://aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/Contact-Us.html



      it redirects fine BUT then using a 301 redirect checker:



      redirect-checker.org/index.php

      you can clearly see that there is 2 301 redirects happening here.. I don't think that's ideal..

      Initially this was happening 2-3 3 times SO as an example if I used the URL to check as:



      aloe-herbal.co.uk/fitness-weight-management.html
      @ www.redirect-checker.org/index.php

      it would give me the following:


      CONGRATULATION. Everything seems to be fine.

      http://aloe-herbal.co.uk/fitness-weight-management.html
      301 Moved Permanently
      http://www.aloe-herbal.co.uk/fitness-weight-management.html
      301 Moved Permanently
      https://www.aloe-herbal.co.uk/fitness-weight-management.html
      200 OK


      I know it says its okay but I am concerned about the extra trip that its having to make..



      So I decided top open a question. Well FIRSTLY thanks for a GREAT related questions feature. WOW gave me a fix straight away:




      magento.stackexchange.com/questions/40400/magento-goes-first-the-http-then-redirects-to-https


      Works like a charm now there is only 1 301 Moved Permanently listed :)



      BUT again if you check: http://aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/Contact-Us.html



      you can see its there 2 times again... That's what I am trying to fix/avoid..



      Can any experts help with this last part?







      https ce-1.9.1.0 .htaccess 301-redirect






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 9 '15 at 17:24









      UmbrellaUmbrella

      84 bronze badges




      84 bronze badges




















          3 Answers
          3






          active

          oldest

          votes


















          0














          Did you put



          RewriteCond %HTTPS off
          RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301]


          before



          RewriteCond %HTTP_HOST !^www.
          RewriteRule ^(.*)$ https://www.%HTTP_HOST%REQUEST_URI [L,R=301]


          in your .htaccess file?



          If so, Apache would rewrite http://aloe-herbal.co.uk to https://aloe-herbal.co.uk and stop processing further rules due to the 'L' flag. Then it would get a new request (https://aloe-herbal.co.uk) which would be rewritten to https://www.aloe-herbal.co.uk, hence double redirect. Try putting the 'www.'-adding bit before the HTTPS part.






          share|improve this answer























          • hello @maciek YES i did put the www part before the https.. I tested it many ways including the way you have stated NOT to do it.. but adding the rules as you have suggested and as I have implemented doesnt seem to work.

            – Umbrella
            Mar 11 '15 at 12:15


















          0














          First, make sure that the unsecure as well as secure base URL under System - Configuration - Web is configured to use https. Then try this in your .htaccess:



          ############################################
          ## enables the usage of %ENV:proto as the protocol (http vs https) in the rewrite rules
          RewriteCond %HTTPS =on
          RewriteRule ^(.*)$ - [env=proto:https]
          RewriteCond %HTTPS !=on
          RewriteRule ^(.*)$ - [env=proto:http]

          ############################################
          ## redirect from non-www to www
          RewriteCond %HTTP_HOST !^www. [NC]
          RewriteRule ^ %ENV:proto://www.%HTTP_HOST%REQUEST_URI [R=301,L]





          share|improve this answer























          • hello simon, to confirm I have used HTTPS in both unsecure AND secure URL in magento configuration. Also re: htaccess rules, that's contradicting with the advice given by @maciek and doesn't work with my setup. It either breaks OR has multiple redirects.

            – Umbrella
            Mar 11 '15 at 12:17











          • @Umbrella the htaccess rules I posted above are only doing one redirect. Did you try them?

            – Simon
            Mar 11 '15 at 12:53











          • yes i did. although it works its NOT ideal as the code you provided has multiple redirects AND has a 302 thrown into it: aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 302 Found aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/customer-service 200 OK where as the code I am using only has the 2 and NO 302 involved. pls chck @ redirect-checker.org/index.php with lst URL gven 1st post

            – Umbrella
            Mar 11 '15 at 13:23












          • the code I am currently using is: # Rewrite any request to the wrong domain to use www. RewriteCond %HTTP_HOST !^www. RewriteRule ^(.*)$ %HTTP_HOST%REQUEST_URI [L,R=301] # Rewrite to HTTPS: RewriteCond %HTTPS off # Don't put www. here. If it is already there it will be included, if not # the ABOVE rule will catch it. RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301] DOES the job apart from the 2 redirects involved for the URL's referenced in first post...

            – Umbrella
            Mar 11 '15 at 13:27


















          0














          Forget about all this htaccess rewrite.
          Set your base url for secure and unsecure in the backend.
          Set yes on use secure url in frontend in the backend.



          Then edit your app/etc/local.xml and include this



          <?xml version="1.0"?>
          <config>
          <frontend>
          <secure_url>
          <all>/</all>
          </secure_url>
          </frontend>
          </config>


          Or at least paste the XML tree frontend and lower in between the config tags.



          EDITED cause mobile screwed up the answer.






          share|improve this answer

























            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "479"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f60170%2fmoved-from-http-to-https-but-include-www-in-url%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            Did you put



            RewriteCond %HTTPS off
            RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301]


            before



            RewriteCond %HTTP_HOST !^www.
            RewriteRule ^(.*)$ https://www.%HTTP_HOST%REQUEST_URI [L,R=301]


            in your .htaccess file?



            If so, Apache would rewrite http://aloe-herbal.co.uk to https://aloe-herbal.co.uk and stop processing further rules due to the 'L' flag. Then it would get a new request (https://aloe-herbal.co.uk) which would be rewritten to https://www.aloe-herbal.co.uk, hence double redirect. Try putting the 'www.'-adding bit before the HTTPS part.






            share|improve this answer























            • hello @maciek YES i did put the www part before the https.. I tested it many ways including the way you have stated NOT to do it.. but adding the rules as you have suggested and as I have implemented doesnt seem to work.

              – Umbrella
              Mar 11 '15 at 12:15















            0














            Did you put



            RewriteCond %HTTPS off
            RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301]


            before



            RewriteCond %HTTP_HOST !^www.
            RewriteRule ^(.*)$ https://www.%HTTP_HOST%REQUEST_URI [L,R=301]


            in your .htaccess file?



            If so, Apache would rewrite http://aloe-herbal.co.uk to https://aloe-herbal.co.uk and stop processing further rules due to the 'L' flag. Then it would get a new request (https://aloe-herbal.co.uk) which would be rewritten to https://www.aloe-herbal.co.uk, hence double redirect. Try putting the 'www.'-adding bit before the HTTPS part.






            share|improve this answer























            • hello @maciek YES i did put the www part before the https.. I tested it many ways including the way you have stated NOT to do it.. but adding the rules as you have suggested and as I have implemented doesnt seem to work.

              – Umbrella
              Mar 11 '15 at 12:15













            0












            0








            0







            Did you put



            RewriteCond %HTTPS off
            RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301]


            before



            RewriteCond %HTTP_HOST !^www.
            RewriteRule ^(.*)$ https://www.%HTTP_HOST%REQUEST_URI [L,R=301]


            in your .htaccess file?



            If so, Apache would rewrite http://aloe-herbal.co.uk to https://aloe-herbal.co.uk and stop processing further rules due to the 'L' flag. Then it would get a new request (https://aloe-herbal.co.uk) which would be rewritten to https://www.aloe-herbal.co.uk, hence double redirect. Try putting the 'www.'-adding bit before the HTTPS part.






            share|improve this answer













            Did you put



            RewriteCond %HTTPS off
            RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301]


            before



            RewriteCond %HTTP_HOST !^www.
            RewriteRule ^(.*)$ https://www.%HTTP_HOST%REQUEST_URI [L,R=301]


            in your .htaccess file?



            If so, Apache would rewrite http://aloe-herbal.co.uk to https://aloe-herbal.co.uk and stop processing further rules due to the 'L' flag. Then it would get a new request (https://aloe-herbal.co.uk) which would be rewritten to https://www.aloe-herbal.co.uk, hence double redirect. Try putting the 'www.'-adding bit before the HTTPS part.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 9 '15 at 20:26









            Maciek LewkowiczMaciek Lewkowicz

            1981 silver badge10 bronze badges




            1981 silver badge10 bronze badges












            • hello @maciek YES i did put the www part before the https.. I tested it many ways including the way you have stated NOT to do it.. but adding the rules as you have suggested and as I have implemented doesnt seem to work.

              – Umbrella
              Mar 11 '15 at 12:15

















            • hello @maciek YES i did put the www part before the https.. I tested it many ways including the way you have stated NOT to do it.. but adding the rules as you have suggested and as I have implemented doesnt seem to work.

              – Umbrella
              Mar 11 '15 at 12:15
















            hello @maciek YES i did put the www part before the https.. I tested it many ways including the way you have stated NOT to do it.. but adding the rules as you have suggested and as I have implemented doesnt seem to work.

            – Umbrella
            Mar 11 '15 at 12:15





            hello @maciek YES i did put the www part before the https.. I tested it many ways including the way you have stated NOT to do it.. but adding the rules as you have suggested and as I have implemented doesnt seem to work.

            – Umbrella
            Mar 11 '15 at 12:15













            0














            First, make sure that the unsecure as well as secure base URL under System - Configuration - Web is configured to use https. Then try this in your .htaccess:



            ############################################
            ## enables the usage of %ENV:proto as the protocol (http vs https) in the rewrite rules
            RewriteCond %HTTPS =on
            RewriteRule ^(.*)$ - [env=proto:https]
            RewriteCond %HTTPS !=on
            RewriteRule ^(.*)$ - [env=proto:http]

            ############################################
            ## redirect from non-www to www
            RewriteCond %HTTP_HOST !^www. [NC]
            RewriteRule ^ %ENV:proto://www.%HTTP_HOST%REQUEST_URI [R=301,L]





            share|improve this answer























            • hello simon, to confirm I have used HTTPS in both unsecure AND secure URL in magento configuration. Also re: htaccess rules, that's contradicting with the advice given by @maciek and doesn't work with my setup. It either breaks OR has multiple redirects.

              – Umbrella
              Mar 11 '15 at 12:17











            • @Umbrella the htaccess rules I posted above are only doing one redirect. Did you try them?

              – Simon
              Mar 11 '15 at 12:53











            • yes i did. although it works its NOT ideal as the code you provided has multiple redirects AND has a 302 thrown into it: aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 302 Found aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/customer-service 200 OK where as the code I am using only has the 2 and NO 302 involved. pls chck @ redirect-checker.org/index.php with lst URL gven 1st post

              – Umbrella
              Mar 11 '15 at 13:23












            • the code I am currently using is: # Rewrite any request to the wrong domain to use www. RewriteCond %HTTP_HOST !^www. RewriteRule ^(.*)$ %HTTP_HOST%REQUEST_URI [L,R=301] # Rewrite to HTTPS: RewriteCond %HTTPS off # Don't put www. here. If it is already there it will be included, if not # the ABOVE rule will catch it. RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301] DOES the job apart from the 2 redirects involved for the URL's referenced in first post...

              – Umbrella
              Mar 11 '15 at 13:27















            0














            First, make sure that the unsecure as well as secure base URL under System - Configuration - Web is configured to use https. Then try this in your .htaccess:



            ############################################
            ## enables the usage of %ENV:proto as the protocol (http vs https) in the rewrite rules
            RewriteCond %HTTPS =on
            RewriteRule ^(.*)$ - [env=proto:https]
            RewriteCond %HTTPS !=on
            RewriteRule ^(.*)$ - [env=proto:http]

            ############################################
            ## redirect from non-www to www
            RewriteCond %HTTP_HOST !^www. [NC]
            RewriteRule ^ %ENV:proto://www.%HTTP_HOST%REQUEST_URI [R=301,L]





            share|improve this answer























            • hello simon, to confirm I have used HTTPS in both unsecure AND secure URL in magento configuration. Also re: htaccess rules, that's contradicting with the advice given by @maciek and doesn't work with my setup. It either breaks OR has multiple redirects.

              – Umbrella
              Mar 11 '15 at 12:17











            • @Umbrella the htaccess rules I posted above are only doing one redirect. Did you try them?

              – Simon
              Mar 11 '15 at 12:53











            • yes i did. although it works its NOT ideal as the code you provided has multiple redirects AND has a 302 thrown into it: aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 302 Found aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/customer-service 200 OK where as the code I am using only has the 2 and NO 302 involved. pls chck @ redirect-checker.org/index.php with lst URL gven 1st post

              – Umbrella
              Mar 11 '15 at 13:23












            • the code I am currently using is: # Rewrite any request to the wrong domain to use www. RewriteCond %HTTP_HOST !^www. RewriteRule ^(.*)$ %HTTP_HOST%REQUEST_URI [L,R=301] # Rewrite to HTTPS: RewriteCond %HTTPS off # Don't put www. here. If it is already there it will be included, if not # the ABOVE rule will catch it. RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301] DOES the job apart from the 2 redirects involved for the URL's referenced in first post...

              – Umbrella
              Mar 11 '15 at 13:27













            0












            0








            0







            First, make sure that the unsecure as well as secure base URL under System - Configuration - Web is configured to use https. Then try this in your .htaccess:



            ############################################
            ## enables the usage of %ENV:proto as the protocol (http vs https) in the rewrite rules
            RewriteCond %HTTPS =on
            RewriteRule ^(.*)$ - [env=proto:https]
            RewriteCond %HTTPS !=on
            RewriteRule ^(.*)$ - [env=proto:http]

            ############################################
            ## redirect from non-www to www
            RewriteCond %HTTP_HOST !^www. [NC]
            RewriteRule ^ %ENV:proto://www.%HTTP_HOST%REQUEST_URI [R=301,L]





            share|improve this answer













            First, make sure that the unsecure as well as secure base URL under System - Configuration - Web is configured to use https. Then try this in your .htaccess:



            ############################################
            ## enables the usage of %ENV:proto as the protocol (http vs https) in the rewrite rules
            RewriteCond %HTTPS =on
            RewriteRule ^(.*)$ - [env=proto:https]
            RewriteCond %HTTPS !=on
            RewriteRule ^(.*)$ - [env=proto:http]

            ############################################
            ## redirect from non-www to www
            RewriteCond %HTTP_HOST !^www. [NC]
            RewriteRule ^ %ENV:proto://www.%HTTP_HOST%REQUEST_URI [R=301,L]






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Mar 10 '15 at 11:58









            SimonSimon

            4,6881 gold badge21 silver badges61 bronze badges




            4,6881 gold badge21 silver badges61 bronze badges












            • hello simon, to confirm I have used HTTPS in both unsecure AND secure URL in magento configuration. Also re: htaccess rules, that's contradicting with the advice given by @maciek and doesn't work with my setup. It either breaks OR has multiple redirects.

              – Umbrella
              Mar 11 '15 at 12:17











            • @Umbrella the htaccess rules I posted above are only doing one redirect. Did you try them?

              – Simon
              Mar 11 '15 at 12:53











            • yes i did. although it works its NOT ideal as the code you provided has multiple redirects AND has a 302 thrown into it: aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 302 Found aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/customer-service 200 OK where as the code I am using only has the 2 and NO 302 involved. pls chck @ redirect-checker.org/index.php with lst URL gven 1st post

              – Umbrella
              Mar 11 '15 at 13:23












            • the code I am currently using is: # Rewrite any request to the wrong domain to use www. RewriteCond %HTTP_HOST !^www. RewriteRule ^(.*)$ %HTTP_HOST%REQUEST_URI [L,R=301] # Rewrite to HTTPS: RewriteCond %HTTPS off # Don't put www. here. If it is already there it will be included, if not # the ABOVE rule will catch it. RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301] DOES the job apart from the 2 redirects involved for the URL's referenced in first post...

              – Umbrella
              Mar 11 '15 at 13:27

















            • hello simon, to confirm I have used HTTPS in both unsecure AND secure URL in magento configuration. Also re: htaccess rules, that's contradicting with the advice given by @maciek and doesn't work with my setup. It either breaks OR has multiple redirects.

              – Umbrella
              Mar 11 '15 at 12:17











            • @Umbrella the htaccess rules I posted above are only doing one redirect. Did you try them?

              – Simon
              Mar 11 '15 at 12:53











            • yes i did. although it works its NOT ideal as the code you provided has multiple redirects AND has a 302 thrown into it: aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 302 Found aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/customer-service 200 OK where as the code I am using only has the 2 and NO 302 involved. pls chck @ redirect-checker.org/index.php with lst URL gven 1st post

              – Umbrella
              Mar 11 '15 at 13:23












            • the code I am currently using is: # Rewrite any request to the wrong domain to use www. RewriteCond %HTTP_HOST !^www. RewriteRule ^(.*)$ %HTTP_HOST%REQUEST_URI [L,R=301] # Rewrite to HTTPS: RewriteCond %HTTPS off # Don't put www. here. If it is already there it will be included, if not # the ABOVE rule will catch it. RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301] DOES the job apart from the 2 redirects involved for the URL's referenced in first post...

              – Umbrella
              Mar 11 '15 at 13:27
















            hello simon, to confirm I have used HTTPS in both unsecure AND secure URL in magento configuration. Also re: htaccess rules, that's contradicting with the advice given by @maciek and doesn't work with my setup. It either breaks OR has multiple redirects.

            – Umbrella
            Mar 11 '15 at 12:17





            hello simon, to confirm I have used HTTPS in both unsecure AND secure URL in magento configuration. Also re: htaccess rules, that's contradicting with the advice given by @maciek and doesn't work with my setup. It either breaks OR has multiple redirects.

            – Umbrella
            Mar 11 '15 at 12:17













            @Umbrella the htaccess rules I posted above are only doing one redirect. Did you try them?

            – Simon
            Mar 11 '15 at 12:53





            @Umbrella the htaccess rules I posted above are only doing one redirect. Did you try them?

            – Simon
            Mar 11 '15 at 12:53













            yes i did. although it works its NOT ideal as the code you provided has multiple redirects AND has a 302 thrown into it: aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 302 Found aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/customer-service 200 OK where as the code I am using only has the 2 and NO 302 involved. pls chck @ redirect-checker.org/index.php with lst URL gven 1st post

            – Umbrella
            Mar 11 '15 at 13:23






            yes i did. although it works its NOT ideal as the code you provided has multiple redirects AND has a 302 thrown into it: aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 302 Found aloe-herbal.co.uk/categories/Bee-Hive-Products/pages/… 301 Moved Permanently aloe-herbal.co.uk/customer-service 200 OK where as the code I am using only has the 2 and NO 302 involved. pls chck @ redirect-checker.org/index.php with lst URL gven 1st post

            – Umbrella
            Mar 11 '15 at 13:23














            the code I am currently using is: # Rewrite any request to the wrong domain to use www. RewriteCond %HTTP_HOST !^www. RewriteRule ^(.*)$ %HTTP_HOST%REQUEST_URI [L,R=301] # Rewrite to HTTPS: RewriteCond %HTTPS off # Don't put www. here. If it is already there it will be included, if not # the ABOVE rule will catch it. RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301] DOES the job apart from the 2 redirects involved for the URL's referenced in first post...

            – Umbrella
            Mar 11 '15 at 13:27





            the code I am currently using is: # Rewrite any request to the wrong domain to use www. RewriteCond %HTTP_HOST !^www. RewriteRule ^(.*)$ %HTTP_HOST%REQUEST_URI [L,R=301] # Rewrite to HTTPS: RewriteCond %HTTPS off # Don't put www. here. If it is already there it will be included, if not # the ABOVE rule will catch it. RewriteRule ^(.*)$ https://%HTTP_HOST%REQUEST_URI [L,R=301] DOES the job apart from the 2 redirects involved for the URL's referenced in first post...

            – Umbrella
            Mar 11 '15 at 13:27











            0














            Forget about all this htaccess rewrite.
            Set your base url for secure and unsecure in the backend.
            Set yes on use secure url in frontend in the backend.



            Then edit your app/etc/local.xml and include this



            <?xml version="1.0"?>
            <config>
            <frontend>
            <secure_url>
            <all>/</all>
            </secure_url>
            </frontend>
            </config>


            Or at least paste the XML tree frontend and lower in between the config tags.



            EDITED cause mobile screwed up the answer.






            share|improve this answer



























              0














              Forget about all this htaccess rewrite.
              Set your base url for secure and unsecure in the backend.
              Set yes on use secure url in frontend in the backend.



              Then edit your app/etc/local.xml and include this



              <?xml version="1.0"?>
              <config>
              <frontend>
              <secure_url>
              <all>/</all>
              </secure_url>
              </frontend>
              </config>


              Or at least paste the XML tree frontend and lower in between the config tags.



              EDITED cause mobile screwed up the answer.






              share|improve this answer

























                0












                0








                0







                Forget about all this htaccess rewrite.
                Set your base url for secure and unsecure in the backend.
                Set yes on use secure url in frontend in the backend.



                Then edit your app/etc/local.xml and include this



                <?xml version="1.0"?>
                <config>
                <frontend>
                <secure_url>
                <all>/</all>
                </secure_url>
                </frontend>
                </config>


                Or at least paste the XML tree frontend and lower in between the config tags.



                EDITED cause mobile screwed up the answer.






                share|improve this answer













                Forget about all this htaccess rewrite.
                Set your base url for secure and unsecure in the backend.
                Set yes on use secure url in frontend in the backend.



                Then edit your app/etc/local.xml and include this



                <?xml version="1.0"?>
                <config>
                <frontend>
                <secure_url>
                <all>/</all>
                </secure_url>
                </frontend>
                </config>


                Or at least paste the XML tree frontend and lower in between the config tags.



                EDITED cause mobile screwed up the answer.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Mar 4 '16 at 19:47









                MichaelMichael

                5051 gold badge4 silver badges13 bronze badges




                5051 gold badge4 silver badges13 bronze badges



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Magento Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f60170%2fmoved-from-http-to-https-but-include-www-in-url%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Get product attribute by attribute group code in magento 2get product attribute by product attribute group in magento 2Magento 2 Log Bundle Product Data in List Page?How to get all product attribute of a attribute group of Default attribute set?Magento 2.1 Create a filter in the product grid by new attributeMagento 2 : Get Product Attribute values By GroupMagento 2 How to get all existing values for one attributeMagento 2 get custom attribute of a single product inside a pluginMagento 2.3 How to get all the Multi Source Inventory (MSI) locations collection in custom module?Magento2: how to develop rest API to get new productsGet product attribute by attribute group code ( [attribute_group_code] ) in magento 2

                    Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

                    Magento 2.3: How do i solve this, Not registered handle, on custom form?How can i rewrite TierPrice Block in Magento2magento 2 captcha not rendering if I override layout xmlmain.CRITICAL: Plugin class doesn't existMagento 2 : Problem while adding custom button order view page?Magento 2.2.5: Overriding Admin Controller sales/orderMagento 2.2.5: Add, Update and Delete existing products Custom OptionsMagento 2.3 : File Upload issue in UI Component FormMagento2 Not registered handleHow to configured Form Builder Js in my custom magento 2.3.0 module?Magento 2.3. How to create image upload field in an admin form