I've installed OTRS 6 on CentOS7 to exlpore it's features and I struggle to make it available via https. It installs Apache, and I have installed the mod_ssl module, created a self-signed certificate and modified the ssl.conf file to point to the private key and the certificate file. When I access the web page via https://server/otrs/index.pl I get the self-signed certificate warning and I'm able to access it but I can still access it via HTTP. Few google searches later I'm still not able to prevent or re-direct all HTTP requests to https. I've found this article Using an SSL certificate with OTRS and it says to put the following lines in the HTTP virtual host configuration:

RewriteEngine On 
RewriteCond %{HTTPS} off 
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

But the problem is that in my ssl.conf there is no section for HTTP virtual host, I can see only one for HTTPS <VirtualHost_default_:443

What am I doing wrong? Any help is much appreciated!

  • Try this rule: RewriteRule ^(.*) https://%{HTTP_HOST}/$1 [R=301,L] – George Udosen Jan 14 '18 at 12:20
  • Thank you. Should I put it in the ssl.conf file under <VirtualHost_default_:443 ? – adam86 Jan 14 '18 at 12:23
  • This should be in the .htaccess file and you should have a line Redirect permanent / https://<your_site_name>/ in the <VirtualHost *:80></VirtualHost> block in your site conf file – George Udosen Jan 14 '18 at 12:30
  • .htaccess - it's not there – adam86 Jan 14 '18 at 13:10
  • Place it here /etc/httpd/conf.d/zzz_otrs.conf from docs I have seen, yours might be called differently – George Udosen Jan 14 '18 at 13:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.