[SOLVED] Forcing SSL over https
Re: Forcing SSL over https
Just confirm, you can now successfully connect to https itself without using the redirect?
-
- Posts: 27
- Joined: 2011/08/06 18:23:49
Re: Forcing SSL over https
Yes. https is working now if I type in https.
Re: Forcing SSL over https
And what do you currently have to attempt the redirection? Anything?
-
- Posts: 27
- Joined: 2011/08/06 18:23:49
Re: Forcing SSL over https
Nothing. I just manually type https.
Re: Forcing SSL over https
So you want to add something to the virtual host definition you're using that does something like
[code]
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
[/code]
[code]
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
[/code]
-
- Posts: 27
- Joined: 2011/08/06 18:23:49
Re: Forcing SSL over https
Sorry for my ignorance, but what configuration file do I put this in?
Re: Forcing SSL over https
Where you put it depends on what you want to affect. For example, if you have separate VirtualHost sections then putting it inside one of those will affect only that Virtual Host. If you do not have any virtual hosts defined then adding it to the main /etc/httpd/conf/httpd.conf file somewhere after the line in the default one that says "### Section 2: 'Main' server configuration" and before the one that says "" should work for the default site. You can test the syntax of a change to httpd.conf by running
[code]
service httpd configtest
[/code]
and once it says "Syntax OK" you can reload it with `service httpd reload`.
[code]
service httpd configtest
[/code]
and once it says "Syntax OK" you can reload it with `service httpd reload`.
-
- Posts: 27
- Joined: 2011/08/06 18:23:49
Re: Forcing SSL over https
Awesome thank you very much it works. :-)
-
- Retired Moderator
- Posts: 18276
- Joined: 2006/12/13 20:15:34
- Location: Tidewater, Virginia, North America
- Contact:
Re: [SOLVED] Forcing SSL over https
Thanks for reporting back. At long last marking this thread [SOLVED] for posterity.