LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-03-2009, 11:03 AM   #1
Jude Terror
LQ Newbie
 
Registered: Dec 2008
Posts: 27

Rep: Reputation: 0
How do you direct all https requests to http?


I'm finding a lot of info on forcing people to go to secure connections, but what about forcing people to nonsecure connections? Can I redirect all requests to an https address to the regular http site?
 
Old 06-03-2009, 11:16 AM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Yes. Switch the ports (80/443) and protocol (http/https) in the examples.
 
Old 06-03-2009, 11:42 AM   #3
Jude Terror
LQ Newbie
 
Registered: Dec 2008
Posts: 27

Original Poster
Rep: Reputation: 0
I'm having trouble finding an example with ports.
 
Old 06-03-2009, 12:38 PM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
What's this info on forcing people to go to secure connections that you found then?

Also you need to say what version of what HTTP daemon you are trying to configure.
 
Old 06-03-2009, 12:50 PM   #5
Jude Terror
LQ Newbie
 
Registered: Dec 2008
Posts: 27

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by AlucardZero View Post
What's this info on forcing people to go to secure connections that you found then?

Also you need to say what version of what HTTP daemon you are trying to configure.
I'm finding apache rewrite rulse for directing non https requests to a specific page, like this:

Code:
RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.com/$1 [R,L]
Would something like this work?

Code:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule (.*) http://www.mydomain.com/$1 [R=301,L]
To clarify, the optimal situation for me would be for users going to https://www.mysite.com or any address beginning with that to be served the exact same files as a user going to http://www.mysite.com.

It doesn't need to actually be secure, just allow people to access the site the same as they would through http through https.

Do you think this is possible at all? If not, a rewrite rule that would redirect anyone coming through https to the main site's index page would be good enough. Would the rule above do that?

Sorry, I find apache very confusing.
 
Old 06-03-2009, 12:51 PM   #6
zeos
Member
 
Registered: Aug 2003
Posts: 150

Rep: Reputation: 15
EDIT: Nevermind, don't do this...it probably won't accomplish your goals

Using mod_rewrite as above should work

Last edited by zeos; 06-03-2009 at 12:56 PM.
 
Old 06-03-2009, 12:56 PM   #7
Jude Terror
LQ Newbie
 
Registered: Dec 2008
Posts: 27

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by zeos View Post
EDIT: Nevermind, don't do this...it probably won't accomplish your goals

Using mod_rewrite as above should work
Haha I was just about to try it and when I hit the quote button you edited the post. Thanks though.
 
Old 06-03-2009, 01:00 PM   #8
zeos
Member
 
Registered: Aug 2003
Posts: 150

Rep: Reputation: 15
Quote:
Originally Posted by Jude Terror View Post
Haha I was just about to try it and when I hit the quote button you edited the post. Thanks though.
Sorry 'bout that...Sometimes I put my keyboard in motion before completely vetting my thoughts.
 
Old 06-03-2009, 07:00 PM   #9
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Quote:
the optimal situation for me would be for users going to https://www.mysite.com or any address beginning with that to be served the exact same files as a user going to http://www.mysite.com
Set the DocumentRoot the same for both SSL and non-SSL. The Rewrite rules will force everyone to http, which by the sound of it isn't what you really want.
 
  


Reply



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 On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you properly redirect all web client requests from http to https? mehoggan Linux - Server 4 06-02-2009 03:49 AM
http relay - tracking http requests wastingtime Linux - Server 2 04-28-2009 06:05 PM
How to direct http and smtp requests adamkini Linux - Newbie 1 04-03-2009 08:18 AM
iptables + squid cannot serve https requests omidm Linux - Networking 4 01-07-2009 02:04 PM
Apache2 HTTPS Direct Problem br00tal Linux - Networking 6 04-22-2008 03:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration