how can only one link on a site (http) be redirected to its https link?

how can only one link on a site (http) be redirected to its https link?

Post by bdu » Sun, 01 Aug 2004 06:21:10


Currently, most stuff on our web site can be accessed using http.
Now we want to redirecte only the logon link which involved user's
password on the site to https.
We know the URL for the logon link is
http://www.yqcomputer.com/
clicks the logon link, we want the URL to be changed to
https://host.my.edu/app/index.php?option=com_login&Itemid=1.

I added this in the httpd.conf file:

-------
Rewri *** gine On
RewriteRule ^/app/index\.php\?option=com_login&Itemid=1$
https://host.my.edu/app/index.php?option=com_login&Itemid=1 [R,L]
--------

But the rewriterule took no effect. Anything wrong with the rewrite
rule? Any other better way to do it?

I would greatly appreciate any advices.

Bing
 
 
 

how can only one link on a site (http) be redirected to its https link?

Post by Marc Marti » Sun, 01 Aug 2004 18:51:48

Bing schrieb:

> But the rewriterule took no effect. Anything wrong with the rewrite
> rule? Any other better way to do it?

You can redirect by using PHP. Just modify your index.php

<?php

[... if option==com AND ItemID==1 ...]

header("Location:
https://host.my.edu/app/index.php?option=com_login&Itemid=1");
exit;

[...]

?>

Marc

 
 
 

how can only one link on a site (http) be redirected to its https link?

Post by Jim Hayte » Wed, 04 Aug 2004 00:34:24

On 30 Jul 2004 14:21:10 -0700, in comp.infosystems.www.servers.unix,



Try this:

Rewri *** gine On
RewriteCond %{QUERY_STRING} ^option=com_login&Itemid=1$
RewriteRule ^/app/index\.php$ https://host.my.edu/app/index.php
[QSA,R,L]


HTH
Jim
 
 
 

how can only one link on a site (http) be redirected to its https link?

Post by bdu » Wed, 04 Aug 2004 06:13:36

Thanks, Marc. I've tried it. For some reason it did not work for me.
I can see the page fine by going directly to
https://host.my.edu/app/index.php?option=com_login&Itemid=1. But
using the header function took a while to show the result and the
result 'The page cannot be displayed' in IE 6. I noticed the URL in
the Address box of the browser was still http://xxx rather than being
changed to https://xxx. But from my testing, I can using the header
function to redirect to some other site whose URL does not have
paramemters, e.g. https://host.my.edu/app. I'm totally confused now.

Any ideas what might be wrong, anybody?

Thanks,

Bing