LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-16-2012, 02:26 AM   #1
john lee
Member
 
Registered: Jun 2001
Location: Sydney, Australia
Posts: 42

Rep: Reputation: 15
Apache 2.x: http for some paths and https for other paths


I am wondering if this can really be done in Apache.

I have installed several web applications on one single 2.x Apache server on Centos 6. I have installed SSL in Apache as well.

I would like to achieve the following:
For App A: user must access using https://samehostname.com/secure
For App B: user must access using http://samehostname.com/public

Any thoughts?
 
Old 07-16-2012, 03:27 AM   #2
Wim Sturkenboom
Senior Member
 
Registered: Jan 2005
Location: Roodepoort, South Africa
Distribution: Slackware 10.1/10.2/12, Ubuntu 12.04, Crunchbang Statler
Posts: 3,786

Rep: Reputation: 282Reputation: 282Reputation: 282
Make everything go through SSL (https). I don't really see a reason why you want to use the mix of http/https for the setup you describe.
 
Old 07-17-2012, 02:33 AM   #3
john lee
Member
 
Registered: Jun 2001
Location: Sydney, Australia
Posts: 42

Original Poster
Rep: Reputation: 15
<VirtualHost _default_:80>
[...]
RewriteEngine on
RewriteRule ^/secure/(.*)$ https://%{SERVER_NAME}/secure/$1 [R=301,L]
[...]
</VirtualHost>


<VirtualHost _default_:443>
[...]
RewriteEngine on
RewriteRule ^/public/(.*)$ http://%{SERVER_NAME}/public/$1 [R=301,L]
[...]
</VirtualHost>
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 to change Apache page from http to https technodweeb Linux - Server 9 03-08-2013 01:42 PM
Apache - I want a timeout for invalid paths Apollo77 Linux - Server 3 11-15-2007 09:48 AM
Apache 2: forward http to https? OneSeventeen Linux - Software 2 07-03-2006 08:10 AM
PHP include() file paths in Apache virtual hosts tawalker Linux - Software 0 09-23-2004 03:16 PM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 11:15 PM


All times are GMT -5. The time now is 12:07 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration