Hi, We have Apache version: 2.2.3 on on Linux O/S. We have recently installed SSL on this webserver. Now when we browse our website using www.domain-name.com it directly opens up in http:// not in https://. For opening the website in https:// we explicitly have to type https://www.domain-name.com in browser. What should we do so that our website opens up directly in https:// irrespective of whether we type www.domain-name.com or http://www.domain-name.com? Regards, IT
This .htaccess should do the trick. Add this to your .htaccess file or make it in the site directory. RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} Code (markup):
Snat, When we search for .htaccess file, we find many such files, like: [root@/]# find -name .htaccess ./home/zabbix/zabbix/frontends/php/conf/.htaccess ./home/zabbix/zabbix/frontends/php/api/.htaccess ./home/zabbix/zabbix/frontends/php/include/classes/.htaccess ./home/zabbix/zabbix/frontends/php/include/.htaccess ./usr/local/src/phpMyAdmin-3.3.8.1-all-languages/libraries/.htaccess ./usr/local/src/phpMyAdmin-3.3.8.1-all-languages/setup/lib/.htaccess ./var/www/html/phpMyAdmin/libraries/.htaccess ./var/www/html/.htaccess [root@/]# So in which .htaccess file should we add these three line of code?Regards,
I can't tell you sadly without knowing which directory your website is hosted in. If you tell me what folder your website is in, I can tell you which one you need to edit.
Dear Snat, We have our website hosted in directory - ./var/www/html/ We added the three lines in .htaccess file present in this directory but this did not work. Any more suggestions... Thanks,