Author |
|
flatcircle
Joined: 27 Jun 2006 Posts: 79
|
Posted: Sat 26 Jul '08 12:47 Post subject: Apache SSL - How to configure to use only SSL on some pages |
|
|
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
|
Posted: Sun 27 Jul '08 9:44 Post subject: |
|
|
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
|
Posted: Thu 31 Jul '08 11:49 Post subject: |
|
|
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
|
Posted: Fri 01 Aug '08 1:22 Post subject: |
|
|
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
|
Posted: Fri 01 Aug '08 3:26 Post subject: |
|
|
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 |
|