Redirecting HTTPS to HTTP

This is a discussion on Redirecting HTTPS to HTTP within the Apache Web Server forums, part of the Web Server and Related Forums category; Hello all, The company I work for used to have their website accessible on both HTTP and HTTPS. We've ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-27-2006
Paul
 
Posts: n/a
Default Redirecting HTTPS to HTTP

Hello all,

The company I work for used to have their website accessible on both
HTTP and HTTPS. We've moved servers from the original host. It's come
to our attention that some people are linking to HTTPS pages and these
are now dead links.

I've set up a test server in the office with the latest version of
Fedora 6, and have been testing out a suggested solution from a search
on Google, using .htaccess:

RewriteEngine On
RewriteCond %{SERVER_PORT} ^443$
RewriteRule (.*) http://%{SERVER_NAME}/$1 [R=301,L]

This should, in theory, forward any requests using HTTPS (port 443) to
the HTTP address. What actually happens is I get a few "invalid
certificate" messages, and then it shows the page on HTTPS!

If this makes sense, and anyone has any idea what I might be doing
wrong, I'd appreciate some help on the matter :)

Thanks!

Paul

  #2 (permalink)  
Old 11-28-2006
devon_banks@comcast.net
 
Posts: n/a
Default Re: Redirecting HTTPS to HTTP


Paul wrote:
> Hello all,
>
> The company I work for used to have their website accessible on both
> HTTP and HTTPS. We've moved servers from the original host. It's come
> to our attention that some people are linking to HTTPS pages and these
> are now dead links.
>
> I've set up a test server in the office with the latest version of
> Fedora 6, and have been testing out a suggested solution from a search
> on Google, using .htaccess:
>
> RewriteEngine On
> RewriteCond %{SERVER_PORT} ^443$
> RewriteRule (.*) http://%{SERVER_NAME}/$1 [R=301,L]
>
> This should, in theory, forward any requests using HTTPS (port 443) to
> the HTTP address. What actually happens is I get a few "invalid
> certificate" messages, and then it shows the page on HTTPS!
>
> If this makes sense, and anyone has any idea what I might be doing
> wrong, I'd appreciate some help on the matter :)
>
> Thanks!
>
> Paul

I get the jist of what you are trying to do here but I'm not suer why
this is not working. The other thing you might try if you have php is
a using virtual host.
For
in ssl.conf
<Virtual Host _default_:443>
DocumentRoot "/var/www/html/sslusers"
ServerName www.example.com:443
### The other stuff that goes in here
###
</Virtual Host>

in httpd.conf
<VirtualHost *:80>
ServerAdmin webmaster@dummy-host.example.com
DocumentRoot /var/www/html ## whatever your current root file
location is
ServerName www..example.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>

in /var/www/html/sslusers directory place index.php
file contents
-------------------------------------------------
<?php
header("location:http://www.example.com")
?>
--------------------------------------------------------------
Or you could put an html page telling them the link has changed.

Not as gracefull as your solution, but it might work.
If someone does find out how do make the Rewrite work I hope they post
it.

I have the reverse problem. I have a 3 sub-domains which I need to
make sure are only accessed via SSL on one machine, I've never set up
multiple SSL domains on one machine or a strictly SSL machine. And on
another machine which have access to one domain via https and another
by http.
This Iater I think I can deal with the former I'm going to have to do
some testing and ask some questions.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB 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 08:47 PM.


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