[support] https and htaccess

Walt Daniels wdlists at gmail.com
Fri Jul 22 15:58:34 UTC 2011


See the comments in the .htaccess distributed with the core.
# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

  # If your site can be accessed both with and without the 'www.' prefix,
you
  # can use one of the following settings to redirect users to your
preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/..
.)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/..
.)
  # uncomment and adapt the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
  # RewriteBase /drupal
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /

  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

On Fri, Jul 22, 2011 at 10:17 AM, Shai Gluskin <shai at content2zero.com>wrote:

> Lynn,
>
> Are you on a Linux server? I think you are talking about using a
> mod_rewrite solution which, I think, only works on Linux.
>
> mod_rewrite is incredibly powerful and fussy. I wouldn't risk advising you
> on the actual script.
>
> I actually think this kind of question might best be handled by the support
> team at your server company. I'm not saying you shouldn't ask here... but if
> you don't get a response that helps, that is another route to go.
>
> Shai
>
> On Fri, Jul 22, 2011 at 10:10 AM, Lynn Stott (Stott Design) <
> lynn at stottdesign.com> wrote:
>
>> Can some help with .htaccess?
>>
>> How do you redirect all
>> https://www.site.com
>> http://www.site.com
>> http://site.com
>>
>> to
>>
>> https://site.com
>>
>> Thanks,
>>
>>
>> --
>> [ Drupal support list | http://lists.drupal.org/ ]
>>
>
>
> --
> [ Drupal support list | http://lists.drupal.org/ ]
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20110722/aeb0bcd7/attachment.html 


More information about the support mailing list