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
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@sander-martijn.com To: support@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/ ]
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@sander-martijn.com To: support@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/ ]
Are you working in Linux or windows? Shyamala ----- Original Message ----- From: sander-martijn To: support@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@sander-martijn.com To: support@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
Debian linux, Apache 2.
Rajaram Shyamala wrote:
Are you working in Linux or windows? Shyamala
----- Original Message ----- *From:* sander-martijn <mailto:sander@sander-martijn.com> *To:* support@drupal.org <mailto:support@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@sander-martijn.com> To: <support@drupal.org> Sent: Monday, September 17, 2007 3:44 AM Subject: [support] http > https redirectAnyone 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@sander-martijn.com> interface developer | architect sander@sander-martijn.com <mailto:sander@sander-martijn.com> www.sander-martijn.com <http://www.sander-martijn.com> ------------------------------------------------------------------------ ------------------------------------------------------------------------ -- [ Drupal support list | http://lists.drupal.org/ ]
Your situation may be vastly different from ours, so this may be of no help at all. But here is how we redirect HTTP to HTTPS for our sites using Apache 2:
<VirtualHost *:80> ServerName www.example.com Redirect / https://www.example.com/ </VirtualHost>
Thanks - that is the easiest way, but only works if you want your entire site in https (https vastly slows down your site so I would almost never want that). I need only one page to be https. Redirecting TO https is no problem:
RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(contact/requestBook)$ https://s24863.gridserver.com/$1 [R=301,L]
Redirecting back FROM https when you go to any of the other sites is what doesn't work - i either get an endless loop (resulting in apache failing) or it stays in https all the time:
# 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]
It has something to do with the way drupal rewrites urls - going to https the url is one thing but by the time it gets to the next condition (on the following line) to rewrite back to http if necessary it thinks it's something else. so while it matches contact/requestBook as the request URI it won't match NOT contact/requestBook for the return url.
I still haven't gotten this working and the securepages maintainer says he can't reproduce the problem with the module. And the site goes live very soon. I've seen many issues posted both on the drupal.org forums on problems with the apache solution above as well as on the module page for the maintainer - so I believe it has something to do with clean urls or someething like that and that there IS a solution - I just can't figure out what it is.
Thanks .sander
Chris Johnson wrote:
Your situation may be vastly different from ours, so this may be of no help at all. But here is how we redirect HTTP to HTTPS for our sites using Apache 2:
<VirtualHost *:80> ServerName www.example.com Redirect / https://www.example.com/
</VirtualHost>
These two might also be helpful:
http://drupal.org/project/securepages and http://drupal.org/node/37932
Cheers,
Bill
sander-martijn wrote:
Thanks - that is the easiest way, but only works if you want your entire site in https (https vastly slows down your site so I would almost never want that). I need only one page to be https. Redirecting TO https is no problem: RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(contact/requestBook)$ https://s24863.gridserver.com/$1 [R=301,L]
Redirecting back FROM https when you go to any of the other sites is what doesn't work - i either get an endless loop (resulting in apache failing) or it stays in https all the time: # 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]
It has something to do with the way drupal rewrites urls - going to https the url is one thing but by the time it gets to the next condition (on the following line) to rewrite back to http if necessary it thinks it's something else. so while it matches contact/requestBook as the request URI it won't match NOT contact/requestBook for the return url.
I still haven't gotten this working and the securepages maintainer says he can't reproduce the problem with the module. And the site goes live very soon. I've seen many issues posted both on the drupal.org forums on problems with the apache solution above as well as on the module page for the maintainer - so I believe it has something to do with clean urls or someething like that and that there IS a solution - I just can't figure out what it is.
Thanks .sander
Chris Johnson wrote:
Your situation may be vastly different from ours, so this may be of no help at all. But here is how we redirect HTTP to HTTPS for our sites using Apache 2:
<VirtualHost *:80> ServerName www.example.com Redirect / https://www.example.com/
</VirtualHost>
--
sander-martijn mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com
Securepages doesn't work properly. It's actually exactly the same problem I see with my apache directives - when redirecting back from https it results in an endless loop of redirects, resulting in apache reporting "this page is redirecting in a way that will never resolve" - or maybe it's firefox that gives up I can't remember.
And I've seen the other post, but I definitely am not going down the multi-site path for one page. That's like killing a cockroach with a shotgun.
Bill Fitzgerald wrote:
These two might also be helpful:
http://drupal.org/project/securepages and http://drupal.org/node/37932
Cheers,
Bill
sander-martijn wrote:
Thanks - that is the easiest way, but only works if you want your entire site in https (https vastly slows down your site so I would almost never want that). I need only one page to be https. Redirecting TO https is no problem: RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(contact/requestBook)$ https://s24863.gridserver.com/$1 [R=301,L]
Redirecting back FROM https when you go to any of the other sites is what doesn't work - i either get an endless loop (resulting in apache failing) or it stays in https all the time: # 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]
It has something to do with the way drupal rewrites urls - going to https the url is one thing but by the time it gets to the next condition (on the following line) to rewrite back to http if necessary it thinks it's something else. so while it matches contact/requestBook as the request URI it won't match NOT contact/requestBook for the return url.
I still haven't gotten this working and the securepages maintainer says he can't reproduce the problem with the module. And the site goes live very soon. I've seen many issues posted both on the drupal.org forums on problems with the apache solution above as well as on the module page for the maintainer - so I believe it has something to do with clean urls or someething like that and that there IS a solution - I just can't figure out what it is.
Thanks .sander
Chris Johnson wrote:
Your situation may be vastly different from ours, so this may be of no help at all. But here is how we redirect HTTP to HTTPS for our sites using Apache 2:
<VirtualHost *:80> ServerName www.example.com Redirect / https://www.example.com/
</VirtualHost>
--
sander-martijn mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com
Hi,
When you turn off both securepages and the apache .htaccess stuff can you got to both the http and https pages without being redirected to the other?
I think this problem is nothing to do with securepages or the .htaccess stuff, it is something else in your configuration.
Gordon.
sander-martijn wrote:
Securepages doesn't work properly. It's actually exactly the same problem I see with my apache directives - when redirecting back from https it results in an endless loop of redirects, resulting in apache reporting "this page is redirecting in a way that will never resolve" - or maybe it's firefox that gives up I can't remember.
And I've seen the other post, but I definitely am not going down the multi-site path for one page. That's like killing a cockroach with a shotgun.
Bill Fitzgerald wrote:
These two might also be helpful:
http://drupal.org/project/securepages and http://drupal.org/node/37932
Cheers,
Bill
sander-martijn wrote:
Thanks - that is the easiest way, but only works if you want your entire site in https (https vastly slows down your site so I would almost never want that). I need only one page to be https. Redirecting TO https is no problem: RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(contact/requestBook)$ https://s24863.gridserver.com/$1 [R=301,L] Redirecting back FROM https when you go to any of the other sites is what doesn't work - i either get an endless loop (resulting in apache failing) or it stays in https all the time: # 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] It has something to do with the way drupal rewrites urls - going to https the url is one thing but by the time it gets to the next condition (on the following line) to rewrite back to http if necessary it thinks it's something else. so while it matches contact/requestBook as the request URI it won't match NOT contact/requestBook for the return url.
I still haven't gotten this working and the securepages maintainer says he can't reproduce the problem with the module. And the site goes live very soon. I've seen many issues posted both on the drupal.org forums on problems with the apache solution above as well as on the module page for the maintainer - so I believe it has something to do with clean urls or someething like that and that there IS a solution - I just can't figure out what it is.
Thanks .sander
Chris Johnson wrote:
Your situation may be vastly different from ours, so this may be of no help at all. But here is how we redirect HTTP to HTTPS for our sites using Apache 2:
<VirtualHost *:80> ServerName www.example.com Redirect / https://www.example.com/
</VirtualHost>
--
sander-martijn mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com
Yes - if neither are on you can get to both no problem. Furthermore if you turn on https to the page then http works until you click on that link at which point it goes to https no problem. But then when you click on any other link it stays in https. Perhaps another module is causing the problem, but I can't figure out which one that would be.
If I can't get it to work then I'll probably turn on https for that link and not redirect people back to http. It's not ideal but better than having people submit cc info insecurely. I assume that this is a form that won't be used by a lot of people and that those that do will do it towards the end of their visit. but it's never ideal to make assumptions about your client's customers.
.s
Gordon Heydon wrote:
Hi,
When you turn off both securepages and the apache .htaccess stuff can you got to both the http and https pages without being redirected to the other?
I think this problem is nothing to do with securepages or the .htaccess stuff, it is something else in your configuration.
Gordon.
sander-martijn wrote:
Securepages doesn't work properly. It's actually exactly the same problem I see with my apache directives - when redirecting back from https it results in an endless loop of redirects, resulting in apache reporting "this page is redirecting in a way that will never resolve" - or maybe it's firefox that gives up I can't remember.
And I've seen the other post, but I definitely am not going down the multi-site path for one page. That's like killing a cockroach with a shotgun.
Bill Fitzgerald wrote:
These two might also be helpful:
http://drupal.org/project/securepages and http://drupal.org/node/37932
Cheers,
Bill
sander-martijn wrote:
Thanks - that is the easiest way, but only works if you want your entire site in https (https vastly slows down your site so I would almost never want that). I need only one page to be https. Redirecting TO https is no problem: RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(contact/requestBook)$ https://s24863.gridserver.com/$1 [R=301,L] Redirecting back FROM https when you go to any of the other sites is what doesn't work - i either get an endless loop (resulting in apache failing) or it stays in https all the time: # 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] It has something to do with the way drupal rewrites urls - going to https the url is one thing but by the time it gets to the next condition (on the following line) to rewrite back to http if necessary it thinks it's something else. so while it matches contact/requestBook as the request URI it won't match NOT contact/requestBook for the return url.
I still haven't gotten this working and the securepages maintainer says he can't reproduce the problem with the module. And the site goes live very soon. I've seen many issues posted both on the drupal.org forums on problems with the apache solution above as well as on the module page for the maintainer - so I believe it has something to do with clean urls or someething like that and that there IS a solution - I just can't figure out what it is.
Thanks .sander
Chris Johnson wrote:
Your situation may be vastly different from ours, so this may be of no help at all. But here is how we redirect HTTP to HTTPS for our sites using Apache 2:
<VirtualHost *:80> ServerName www.example.com Redirect / https://www.example.com/
</VirtualHost>
--
sander-martijn mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com
Given that you're running out of time, do you have the skills to mock up a custom module to do the job? If I was having problems with secure pages I might consider doing this rather than trying to get the Mod rewrite rules to work.
Simple module that implements hook_init and does the tests you want with a drupal_goto call at the end?
Just thinking out of the box....
Dave
________________________________
From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of sander-martijn Sent: Monday, September 24, 2007 6:25 AM To: support@drupal.org Subject: Re: [support] http > https redirect
Securepages doesn't work properly. It's actually exactly the same problem I see with my apache directives - when redirecting back from https it results in an endless loop of redirects, resulting in apache reporting "this page is redirecting in a way that will never resolve" - or maybe it's firefox that gives up I can't remember.
And I've seen the other post, but I definitely am not going down the multi-site path for one page. That's like killing a cockroach with a shotgun.
Bill Fitzgerald wrote:
These two might also be helpful:
http://drupal.org/project/securepages and http://drupal.org/node/37932
Cheers,
Bill
sander-martijn wrote:
Thanks - that is the easiest way, but only works if you want your entire site in https (https vastly slows down your site so I would almost never want that). I need only one page to be https. Redirecting TO https is no problem: RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(contact/requestBook)$ https://s24863.gridserver.com/$1 [R=301,L] Redirecting back FROM https when you go to any of the other sites is what doesn't work - i either get an endless loop (resulting in apache failing) or it stays in https all the time: # 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] It has something to do with the way drupal rewrites urls - going to https the url is one thing but by the time it gets to the next condition (on the following line) to rewrite back to http if necessary it thinks it's something else. so while it matches contact/requestBook as the request URI it won't match NOT contact/requestBook for the return url. I still haven't gotten this working and the securepages maintainer says he can't reproduce the problem with the module. And the site goes live very soon. I've seen many issues posted both on the drupal.org forums on problems with the apache solution above as well as on the module page for the maintainer - so I believe it has something to do with clean urls or someething like that and that there IS a solution - I just can't figure out what it is. Thanks .sander Chris Johnson wrote:
Your situation may be vastly different from ours, so this may be of no help at all. But here is how we redirect HTTP to HTTPS for our sites using Apache 2: <VirtualHost *:80> ServerName www.example.com Redirect / https://www.example.com/ </VirtualHost>
-- ------------------------------------------------------------------------ sander-martijn mailto:sander@sander-martijn.com mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com http://www.sander-martijn.com ------------------------------------------------------------------------
I thought about that - I have the php skills but am not sure in this short time that I have the drupal skills to build the module. Furthermore I'm feeling like if i can't get an apache directive or a module to work, I think my module would likely have the same problem. There has to be a conflict somewhere whether it's drupal, another module or the host's server config.
.s
Metzler, David wrote:
Given that you're running out of time, do you have the skills to mock up a custom module to do the job? If I was having problems with secure pages I might consider doing this rather than trying to get the Mod rewrite rules to work.
Simple module that implements hook_init and does the tests you want with a drupal_goto call at the end?
Just thinking out of the box....
Dave
*From:* support-bounces@drupal.org [mailto:support-bounces@drupal.org] *On Behalf Of *sander-martijn *Sent:* Monday, September 24, 2007 6:25 AM *To:* support@drupal.org *Subject:* Re: [support] http > https redirect
Securepages doesn't work properly. It's actually exactly the same problem I see with my apache directives - when redirecting back from https it results in an endless loop of redirects, resulting in apache reporting "this page is redirecting in a way that will never resolve"
- or maybe it's firefox that gives up I can't remember.
And I've seen the other post, but I definitely am not going down the multi-site path for one page. That's like killing a cockroach with a shotgun.
Bill Fitzgerald wrote:
These two might also be helpful:
http://drupal.org/project/securepages and http://drupal.org/node/37932
Cheers,
Bill
sander-martijn wrote:
Thanks - that is the easiest way, but only works if you want your entire site in https (https vastly slows down your site so I would almost never want that). I need only one page to be https. Redirecting TO https is no problem: RewriteCond %{SERVER_PORT} !^443$ RewriteRule ^(contact/requestBook)$ https://s24863.gridserver.com/$1 [R=301,L]
Redirecting back FROM https when you go to any of the other sites is what doesn't work - i either get an endless loop (resulting in apache failing) or it stays in https all the time: # 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]
It has something to do with the way drupal rewrites urls - going to https the url is one thing but by the time it gets to the next condition (on the following line) to rewrite back to http if necessary it thinks it's something else. so while it matches contact/requestBook as the request URI it won't match NOT contact/requestBook for the return url.
I still haven't gotten this working and the securepages maintainer says he can't reproduce the problem with the module. And the site goes live very soon. I've seen many issues posted both on the drupal.org forums on problems with the apache solution above as well as on the module page for the maintainer - so I believe it has something to do with clean urls or someething like that and that there IS a solution - I just can't figure out what it is.
Thanks .sander
Chris Johnson wrote:
Your situation may be vastly different from ours, so this may be of no help at all. But here is how we redirect HTTP to HTTPS for our sites using Apache 2:
<VirtualHost *:80> ServerName www.example.com http://www.example.com Redirect / https://www.example.com/
</VirtualHost>
--
sander-martijn mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com http://www.sander-martijn.com
--
sander-martijn mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com
I haven't used this, but check out the Secure Pages project: http://drupal.org/project/securepages
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of sander-martijn Sent: Sunday, September 16, 2007 3:14 PM To: support@drupal.org 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
I tried it. It's not working right for me. I'm in discussions with the creator right now, hoping to resolve that.
It's driving me crazy that I can't get apache redirects to work with drupal though. Much faster than the module.
.s
Metzler, David wrote:
I haven't used this, but check out the Secure Pages project: http://drupal.org/project/securepages
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of sander-martijn Sent: Sunday, September 16, 2007 3:14 PM To: support@drupal.org 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