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

This is a discussion on how can only one link on a site (http) be redirected to its https link? within the Linux Web Servers forums, part of the Web Server and Related Forums category; Currently, most stuff on our web site can be accessed using http. Now we want to redirecte only the logon ...


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-30-2004
Bing
 
Posts: n/a
Default how can only one link on a site (http) be redirected to its https link?

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://host.my.edu/app/index.php?opt...login&Itemid=1. If user
clicks the logon link, we want the URL to be changed to
https://host.my.edu/app/index.php?op...login&Itemid=1.

I added this in the httpd.conf file:

-------
RewriteEngine On
RewriteRule ^/app/index\.php\?option=com_login&Itemid=1$
https://host.my.edu/app/index.php?op...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
  #2 (permalink)  
Old 07-31-2004
Marc Martin
 
Posts: n/a
Default Re: how can only one link on a site (http) be redirected to its httpslink?

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
  #3 (permalink)  
Old 08-02-2004
Bing
 
Posts: n/a
Default Re: how can only one link on a site (http) be redirected to its https link?

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?op...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

Marc Martin <coder@gmx-topmail.de> wrote in message news:<cefq3s$c7k$02$1@news.t-online.com>...
> 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

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:07 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0