http to https redirect

Moderator: crythias

Locked
mustu
Znuny newbie
Posts: 23
Joined: 29 Mar 2011, 05:31
Znuny Version: 3.0.10
Contact:

http to https redirect

Post by mustu »

Hi,

I did tried all the methods of http to https redirect but it didn't worked for my OTRS. in the SysConfig>>Core the http type is set to HTTPS and it;s workign perfectly on https. What I need is to force redirection of http://mycomany.com/otrs/index.pl to https://mycomany.com/otrs/index.pl.

I tried putting the rewrite condition in an .htaccess in /opt/otrs/var/httpd/htdocs/ but no effect. I also tried to put the rewrite condition in http.conf but also no effect. any clue?

I've followed the following articles but didn't worked.

http://wiki.apache.org/httpd/RewriteHTTPToHTTPS
http://www.cyberciti.biz/tips/howto-apa ... tions.html
www.whoopis.com/howtos/apache-rewrite.html
OTRS 3.0.10 + mysql + CentOS 5.6.
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: http to https redirect

Post by Wolfgangf »

I'm using the Apache rewrite module to solve this
- make sure rewirte module is loaded in apache
- place your .htaccess in the DocumentRoot of your apache

here is my .htaccess, using url /admin for Agentlogin, /customer for customerlogin

Code: Select all

order deny,allow
Allow from all
Options +FollowSymlinks
<IfModule mod_rewrite.c>
        RewriteEngine on
        # Hostname only -> Customer Login
        RewriteCond %{REQUEST_URI} ^.*/$
        RewriteRule ^.*$ https://<your_host_name>/otrs/customer.pl [R]
        # Customer Login
        RewriteCond %{REQUEST_URI} ^.*/customer/?$
        RewriteRule ^.*$ https://<your_host_name>/otrs/customer.pl [R]
        # Agent Login
        RewriteCond %{REQUEST_URI} ^.*/admin/?$
        RewriteRule ^.*$ https://<your_host_name>/otrs/index.pl [R]
</IfModule>
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
MichaelR
Znuny expert
Posts: 250
Joined: 12 Oct 2010, 01:35
Znuny Version: 3.0.9
Company: LRS Health

Re: http to https redirect

Post by MichaelR »

Does putting it in apache2-httpd.include.conf change anything?
OTRS: 3.0.9 & ITSM 3.0.4 - OS: Windows 7 - DB: MySQL - Heaps of random/useful hacks :)
[Major Code Changes]
ArticleFreeTime1-3
Ability to search ArticleFreeText
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: http to https redirect

Post by Wolfgangf »

depends on your apache config
in my case, mod_rewrite is loaded in http.conf and I have a separae .htaccess file in the http servers document root
you could enable rewirte logging to see what going on by putting a file like rewrite.conf into apache/conf.d/

Code: Select all

<IfModule mod_rewrite.c>
    RewriteLog /<apache_log_path>/mod_rewrite_log
    RewriteLogLevel 3
</IfModule>
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
Locked