Christopher Juckins

SysAdmin Tips, Tricks and other Software Tools

User Tools

Site Tools


force_https_ssl_on_a_website

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

force_https_ssl_on_a_website [2025/03/20 18:37] – created juckinsforce_https_ssl_on_a_website [2025/03/20 18:38] (current) juckins
Line 23: Line 23:
 </code> </code>
  
 +----
  
 +__Using httpd.conf__:
 +
 +Edit /etc/httpd/conf/httpd.conf such as the following:
 +
 +<code>
 +# Force <DIR> to use SSL
 +RewriteEngine on
 +RewriteCond   %{SERVER_PORT}  !^443$
 +RewriteRule ^/<DIR>(.*)$ https://%{HTTP_HOST}/<DIR>$1 [L,R]
 +</code>
 +
 +Example:
 +<code>
 +# Force Nagios to use SSL
 +RewriteEngine on
 +RewriteCond   %{SERVER_PORT}  !^443$
 +RewriteRule ^/nagios(.*)$ https://%{HTTP_HOST}/nagios$1 [L,R]
 +</code>
force_https_ssl_on_a_website.1742510279.txt.gz · Last modified: 2025/03/20 18:37 by juckins