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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Mar 2010
    Posts
    235
    Thanks
    39
    Thanked 6 Times in 6 Posts

    URL Rewrite for www,http

    I would like to redirect the following urls to https://www:

    1. www.
    2. http://
    3. https://


    Below is what I have so far
    PHP Code:
    RewriteEngine On
    RewriteCond 
    %{HTTP_HOST} !^www. [NC,OR]
    RewriteCond %{HTTP_HOST} !^http: [NC]
    RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L] 

  • #2
    New to the CF scene
    Join Date
    Oct 2011
    Location
    Oslo
    Posts
    1
    Thanks
    0
    Thanked 1 Time in 1 Post

    Smile redirect

    I think this would work:


    PHP Code:
    RewriteEngine on
    RewriteCond 
    %{HTTP_HOST} ^site.com$
    RewriteRule ^$ https://www.site.com [R=301,L] 
    Last edited by Inigoesdr; 10-23-2011 at 12:07 AM.

  • Users who have thanked billigseo for this post:

    Samhain13 (11-01-2011)

  • #3
    Regular Coder Samhain13's Avatar
    Join Date
    Aug 2008
    Location
    Pilipinas
    Posts
    169
    Thanks
    4
    Thanked 18 Times in 18 Posts
    ^ Not sure if it was what OP was looking for but it helped me with another issue. Thanks.
    I am a Man of Truth. I am a Free Human Person. I am a Peacemaker.
    ** Independent Multimedia Artist in Pasig **


  •  

    Tags for this Thread

    Posting Permissions

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