[support] http > https redirect

sander-martijn sander at sander-martijn.com
Mon Sep 17 14:51:02 UTC 2007


Debian linux, Apache 2.

Rajaram Shyamala wrote:
> Are you working in Linux or windows?
> Shyamala
>
>     ----- Original Message -----
>     *From:* sander-martijn <mailto:sander at sander-martijn.com>
>     *To:* support at drupal.org <mailto:support at drupal.org>
>     *Sent:* Monday, September 17, 2007 5:45 PM
>     *Subject:* Re: [support] http > https redirect
>
>     Thanks for that information but all it tells me is that I do
>     indeed understand how to do the redirect, it's just not working as
>     expected.  The only thing I learned was "place this code above
>     Drupal 's own URL rewrite, but below the command RewriteEngine
>     on." but I already tried both above and below and it's not working
>     in either place.
>
>
>
>
>     Shyamala wrote:
>>     Refer:
>>     http://drupal.org/node/16084
>>     http://drupal.org/node/38960
>>     http://www.askapache.com/htaccess/apache-htaccess.html
>>
>>     "How to create 301 redirects in Drupal Apache mod_rewrite
>>     Edit your .htaccess file in a text editor. [Note: Be sure to save the file 
>>     in "UTF-8" format.]
>>
>>     In the file, you will find the commands:
>>
>>
>>     # Various rewrite rules.
>>     <IfModule mod_rewrite.c>
>>       RewriteEngine on
>>
>>       # Modify the RewriteBase if you are using Drupal in a subdirectory and
>>       # the rewrite rules are not working properly.
>>       #RewriteBase /drupal
>>
>>     RewriteBase /
>>     Immediately after that code -- and before the Drupal-provided "Rewrite 
>>     old-style URLs" commands -- add your rewrite rules using the following 
>>     format:
>>
>>
>>     #custom redirects
>>
>>     RewriteRule ^old/URL/path$ http://yourdomain.com/new/path [R=301,L]
>>
>>     #end custom redirects
>>     Note the convention: The old path is simply the path off the root. The new 
>>     path is the full path, including the domain. The [R=301,L] code is the 301 
>>     redirect instruction. (axbom notes: "The 301 tells browsers and spiders it 
>>     is a permanent redirect, and the L ensures that no other rewrites are 
>>     processed on the URL before it reaches Drupal; Hence place this code above 
>>     Drupal 's own URL rewrite, but below the command RewriteEngine on.")  "
>>
>>
>>
>>     ----- Original Message ----- 
>>     From: "sander-martijn" <sander at sander-martijn.com>
>>     To: <support at drupal.org>
>>     Sent: Monday, September 17, 2007 3:44 AM
>>     Subject: [support] http > https redirect
>>
>>
>>       
>>>     Anyone know what I need to do to get individual pages to redirect to
>>>     https?
>>>
>>>     These 2 lines work:
>>>     RewriteCond %{SERVER_PORT} !^443$
>>>     RewriteRule ^(contact/requestBook)$ https://s24863.gridserver.com/$1
>>>     [R=301,L]
>>>
>>>     These lines, which should be the exact opposite, redirect all pages to 
>>>     http:
>>>     # Redirect non-secure pages to HTTP if requested by HTTPS
>>>      RewriteCond %{SERVER_PORT} ^443$
>>>      RewriteCond %{REQUEST_URI} !^contact/requestBook$
>>>      RewriteRule ^(.*)$ http://s24863.gridserver.com/$1 [R=301,L]
>>>
>>>     I've tried all options here including node/387, index.php?q=node/387,
>>>     including/excluding parens etc - none have worked.
>>>
>>>     Obviously as is the contact/requestBook page ends in an endless loop.
>>>
>>>     I tried the securepages module but it's broken.
>>>
>>>     .sander
>>>     -- 
>>>     [ Drupal support list | http://lists.drupal.org/ ] 
>>>         
>>
>>       
>
>     -- 
>     ------------------------------------------------------------------------
>
>     sander-martijn <mailto:sander at sander-martijn.com>
>     interface developer | architect
>     sander at sander-martijn.com <mailto:sander at sander-martijn.com>
>     www.sander-martijn.com <http://www.sander-martijn.com>
>
>     ------------------------------------------------------------------------
>
>     ------------------------------------------------------------------------
>     -- 
>     [ Drupal support list | http://lists.drupal.org/ ]
>

-- 
------------------------------------------------------------------------

sander-martijn <mailto:sander at sander-martijn.com>
interface developer | architect
sander at sander-martijn.com <mailto:sander at sander-martijn.com>
www.sander-martijn.com <http://www.sander-martijn.com>

------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20070917/7adceb8d/attachment-0001.htm 


More information about the support mailing list