[geeklog-users] ssl for admin functions

Tony Bibbs tony at tonybibbs.com
Mon Feb 2 12:56:00 EST 2004


Assuming you are using a fairly recent version of PHP you could do this 
in lib-common.php *after* the include of config.php:

if (stristr($_SERVER["SERVER_PROTOCOL"],'https')) {
     $_CONF['site_url'] = 'https://mydomain';
} else {
     $_CONF['site_url'] = 'http://mydomain';
}

This assumes that your admins login using some page that is SSL'd and 
from that point on the snippet above should keep them in SSL.

--Tony


Ted Roby wrote:
> I am attempting to use SSL to handle any traffic to http://mydomain/admin.
> 
> I am doing this with redirects in my Apache conf file like this:
> 
> RedirectMatch admin$ https://mydomain/admin/
> RedirectMatch admin(.+)$ https://mydomain/admin$1
> 
> (note, mydomain is replaced with a valid domain)
> 
> I have successfully configured two VirtualHosts. One is on port 80, and the
> other handles SSL on port 443.
> 
> However, if I make any changes as an Admin, those changes are not saved.
> 
> I suspect the culprit to be the following line in my config.php script:
> 
> $_CONF['site_url']          = 'http://mydomain';
> 
> My goal is to leave normal users on port 80, while redirecting admins
> over port 443. Again, the only problem with this is that changes are
> not being saved.
> 
> Can someone point me in the right direction to get this to work?
> 
> 
> ---
> Random fortune:
> 
> A long-forgotten loved one will appear soon.
> 
> Buy the negatives at any price.
> 
> _______________________________________________
> geeklog-users mailing list
> geeklog-users at lists.geeklog.net
> http://lists.geeklog.net/listinfo/geeklog-users



More information about the geeklog-users mailing list