logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache SSL - How to configure to use only SSL on some pages
Author
flatcircle



Joined: 27 Jun 2006
Posts: 79

PostPosted: Sat 26 Jul '08 12:47    Post subject: Apache SSL - How to configure to use only SSL on some pages Reply with quote

Hello

I have several websites running on port 80 by using Virtual Hosts.
Only for specific (login)pages I want to use SSL.

Is this possible? I mean, the site is running on port 80. How do I have to configure my Virtual Host when users go to this specific login-page, https is used?

Regards.
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Sun 27 Jul '08 9:44    Post subject: Reply with quote

Got certificates?
Got mod_ssl?
Got ../Apache../conf/extra/httpd-ssl.conf?

or simply;

Got SSL working yet? Start there if you haven't.
Back to top
chainsaw81



Joined: 31 Jul 2008
Posts: 1

PostPosted: Thu 31 Jul '08 11:49    Post subject: Reply with quote

hello.

i search a solution for the same problem.
my website was running totaly ssl-protected. now i need just one folder/site with no ssl-protection.

how ca i do this?

my actually .htaccess:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)SSL$ https://www.mydomain.org/$1 [R]

thank you!
greetz
chainsaw
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 01 Aug '08 1:22    Post subject: Reply with quote

chainsaw81:

How about just dropping same .htaccess in the folder you do not want SSL on only in reverse. If they come into that folder NOT port 80 then send them to port 80, as you done above to send them to https.

It's juat a random thought, may not work tho cause that htaccess you posted is in the DocRoot I'd suspect.

flatcircle:
???
Back to top
adonat



Joined: 03 Jun 2008
Posts: 18

PostPosted: Fri 01 Aug '08 3:26    Post subject: Reply with quote

RewriteEngine on
RewriteLog logs/Mod.Rewrite.log
RewriteLogLevel 0

RewriteCond %{HTTPS} off
RewriteRule (/phpmyadmin.*|/eaccelerator.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,S=1]

RewriteCond %{HTTPS} on
RewriteRule !(/phpmyadmin.*|/eaccelerator.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC]


This is what I have ... Works 100% Don't know if it is the best way.

Have to include it in HTTPD.CONF & HTTPD-SSL.CONF

I know this checks ALL requests to the server but I have seen people have many mnay more lines then this and it doesn't seem to slow down the server or give it too much more overhead.
S=1 Means to skip one rule if it matches
NC = no case or case insensitive
R=301 tell browser it is a permenant redirect

Here is mod rewrite cheat sheat

http://www.addedbytes.com/apache/mod_rewrite-cheat-sheet/

Couldn't figure out for the longest time why it would switch to https and not back... well because https is set up as a virtual host and each host needs it in there.. i wasted 12 hours of my life figuring that out btw *slaps forehead*
Back to top


Reply to topic   Topic: Apache SSL - How to configure to use only SSL on some pages View previous topic :: View next topic
Post new topic   Forum Index -> Apache