Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Nov 2010
    Posts
    393
    Thanks
    48
    Thanked 1 Time in 1 Post

    Exclamation .htaccess problem

    Hello,

    My .htaccess will redirect from:

    From: www.example.com/
    To: https://example.com/
    From: http://www.example.com/
    To: https://www.example.com
    From: http://example.com/
    To: https://example.com

    but not:

    From: http://www.example.com/
    To: https://example.com/

    .htaccess Code:
    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www.example.com [NC]
    RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ https://example.com/$1 [R,L]
    Note: I have replaced my websites name with domain due to being under lock and key for the time being.

    Does anyone have any idea how to fix this please?

    Best Regards,
    Tim
    Last edited by VIPStephan; 08-18-2012 at 11:13 AM. Reason: changed domains to example.com

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,701
    Thanks
    6
    Thanked 1,011 Times in 984 Posts
    If you use example domains then please use example.com since that is what it’s there for (or at least disable auomatic link parsing in posts; there is a checkbox for that below the reply field). We don’t wanna advertise a third party domain hosting site, do we?

  • #3
    Regular Coder
    Join Date
    Nov 2010
    Posts
    393
    Thanks
    48
    Thanked 1 Time in 1 Post
    Quote Originally Posted by VIPStephan View Post
    If you use example domains then please use example.com since that is what it’s there for (or at least disable auomatic link parsing in posts; there is a checkbox for that below the reply field). We don’t wanna advertise a third party domain hosting site, do we?
    Sorry VIPStephan

  • #4
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post
    RewriteCond %{HTTP_HOST} ^www.example.com [NC]
    RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

    Will get applied for http://www.example.com/ and hence it will redirect to http://example.com and not https://example.com.

    Moreover i see there is no https://www.example.com destination in the RewriteRule.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •