Switching between HTTP and HTTPS

From Joomla! Documentation
(Difference between revisions)
Jump to: navigation, search
(New page: {{underconstruction}}{{review}} For setting up the certificate, the simplest way is to get your host to do it for you. Once you've bought a Dedicated IP and SSL certificate, simply ask yo...)
 

Latest revision as of 05:52, 26 March 2010


For setting up the certificate, the simplest way is to get your host to do it for you. Once you've bought a Dedicated IP and SSL certificate, simply ask your host to help and they will get it signed and install it in the correct location for you. Once it's done, you should be able to manually enter HTTP or HTTPS on any page.

If you're also asking how to automatically switch between HTTP and HTTPS depending on which page you're on, most of the work is done for you if you set your SECUREURL correctly in your VirtueMart configuration (i.e. set to https://yourdomain.com). If you have other pages on your site that you want to be secured (as I do), then you can handle these through your .htaccess. As an example, to switch from HTTP to HTTPS on any page that has 'abc/def' or 'ghi' in the URL, add something like this:

Code:

RewriteCond %{HTTPS} off
RewriteRule ^(abc/def|ghi)(.*)/?$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]


... and to switch from HTTPS back to HTTP on any page that has 'home' or 'help' in the URL, do something like this:

Code:

RewriteCond %{HTTPS} on
RewriteRule ^(home|help)(.*)/?$ http://%{HTTP_HOST}%{REQUEST_URI} [R=301,NC,L]
Personal tools
Namespaces

Variants
Actions
Navigation
Joomla! Sites
Toolbox