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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 |
|
|||
|
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 |
|
|||
|
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 | |
|
|