I'm trying to require SSL for drupal login and admin pages and it seems that this should work but it doesn't redirect if added to httpd.conf or to .htaccess (I've tried both)
RewriteCond %{REQUEST_URI} ^/(user|admin) RewriteRule ^(.*)$ https://%%7BSERVER_NAME%7D/$1 [L,R]
Shouldn't this be enough so that the URL...(googling suggests that it is)
http://cms.tobyhouse.com/user/login is automatically redirected to https://cms.tobyhouse.com/user/login
?
Craig
This is what I have in my /etc/httpd/conf/httpd.conf file:- <Directory "/var/www/html"> RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] RewriteCond %{HTTPS} !=on RewriteRule .* https://%%7BHTTP_HOST%7D:443%%7BREQUEST_URI%7D [QSA,R=permanent,L]
I hope this helps,
Ian
Craig White wrote:
I'm trying to require SSL for drupal login and admin pages and it seems that this should work but it doesn't redirect if added to httpd.conf or to .htaccess (I've tried both)
RewriteCond %{REQUEST_URI} ^/(user|admin) RewriteRule ^(.*)$ https://%%7BSERVER_NAME%7D/$1 [L,R]
Shouldn't this be enough so that the URL...(googling suggests that it is)
http://cms.tobyhouse.com/user/login is automatically redirected to https://cms.tobyhouse.com/user/login
?
Craig
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
On Thu, 2008-05-08 at 18:06 -0700, Craig White wrote:
I'm trying to require SSL for drupal login and admin pages and it seems that this should work but it doesn't redirect if added to httpd.conf or to .htaccess (I've tried both)
RewriteCond %{REQUEST_URI} ^/(user|admin) RewriteRule ^(.*)$ https://%%7BSERVER_NAME%7D/$1 [L,R]
Shouldn't this be enough so that the URL...(googling suggests that it is)
http://cms.tobyhouse.com/user/login is automatically redirected to https://cms.tobyhouse.com/user/login
---- nevermind...the rules work but they had to be higher up in the re-write rules to work
Craig