vHost and mod_rewrite

Moderator: crythias

Locked
rzima
Znuny newbie
Posts: 25
Joined: 04 Aug 2016, 08:37
Znuny Version: 6.0.13
Real Name: rzima

vHost and mod_rewrite

Post by rzima »

Hi,
I'm trying to change the direct URL from http://help.proferis.com/otrs/customer.pl to something shorter.
I want to remove /otrs/customer.pl from URL.
I tried to add a rule

Code: Select all

RewriteRule ^/$ /otrs/index.pl [R]
to my vHost configuration (rewrite module is enabled), but there is no effect.
Maybe configuration file is not suitable.

Link: help.proferis.com -> redirect to customer panel
Link: admhelp.proferis.com -> redirect to admin panel

What change, add, delete from config? help
I am open to modifications.

Server Version: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.20 OpenSSL/1.0.1f
/etc/apache2/sites-enabled/help.proferis.com.conf

Code: Select all

<VirtualHost *:80>
    Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/"
    ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"
    ServerName  help.proferis.com
    ServerAdmin it@proferis.com
    DocumentRoot /opt/otrs/var/httpd/htdocs/
    ServerSignature OFF

    <Location /otrs/>
        SetHandler perl-script
        PerlResponseHandler ModPerl::Registry
        PerlOptions +ParseHeaders
        PerlSetupEnv On
        Options +ExecCGI
    </Location>

    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>

    <Directory /opt/otrs/var/httpd/htdocs/>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
        RedirectMatch ^/$ http://help.proferis.com/otrs/customer.pl
      			 no effect #RewriteEngine On
       			 no effect #RewriteRule ^/$ /otrs/customer.pl [R]
    </Directory>

  # Allowed values: debug, info, notice, warn, error, crit, alert, emerg
    LogLevel warn
    ErrorLog /var/log/apache2/otrs-err.log
    CustomLog /var/log/apache2/otrs-acc.log combined
</VirtualHost>

<VirtualHost *:80>
    DocumentRoot /opt/otrs/var/httpd/htdocs/
    ServerName  admhelp.proferis.com
    <Directory /opt/otrs/var/httpd/htdocs/>
        RedirectMatch ^/$ http://help.proferis.com/otrs/index.pl
    </Directory>
</VirtualHost>

coolmf
Znuny newbie
Posts: 37
Joined: 02 Nov 2015, 16:29
Znuny Version: 5.0.26

Re: vHost and mod_rewrite

Post by coolmf »

Please look at this guide: viewtopic.php?t=9329
OTRS 5.0.26 with ITSM, and FAQ module on CentOS 7 with MariaDB and Apache
Using LDAPS for customers and agents against Azure AD
Locked