Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2005
    Posts
    393

    Does anyone know the mod rewrite code to direct to www. and https?

    Does anyone know the mod rewrite code to direct to www. and https?

  2. #2
    Join Date
    Mar 2008
    Location
    UK.
    Posts
    225
    [ SSL ]
    RewriteCond %{HTTPS} off
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

    [ WWW ]
    RewriteCond %{HTTP_HOST} ^domain.com [NC]
    RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]

    -----

    Of course, don't forget to do "RewriteEngine On".
    Current Status: Coming up with ideas for a new SaaS.

  3. #3
    Join Date
    Oct 2005
    Posts
    393
    Thanks! That worked.

  4. #4
    Join Date
    Mar 2008
    Location
    UK.
    Posts
    225
    No worries.
    Current Status: Coming up with ideas for a new SaaS.

Posting Permissions

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