# OpenGnsys Web Admin Console template configuration for Apache.
Alias /opengnsys CONSOLEDIR
# PHP-FPM configuration
SetHandler "proxy:fcgi://127.0.0.1:9000"
RewriteEngine On
# Redirect HTTP to HTTPS and default configuration.
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
Require all granted
Options -Indexes +FollowSymLinks
DirectoryIndex index.php
AddType octet/stream .pkg
Alias /opengnsys3 CONSOLEDIR3
# Redirect HTTP to HTTPS and default configuration.
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
Require all granted
Options -Indexes +FollowSymLinks
DirectoryIndex index.html index.php
AddType octet/stream .pkg
# Redirect HTTP to HTTPS and RESTful configuration.
#RewriteBase /opengnsys3/rest/web
#RewriteRule .? - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#RewriteCond %{HTTPS} !=on
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R]
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteRule ^ index.php [QSA,L]
DirectoryIndex app.php
RewriteEngine On
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
# Sets the HTTP_AUTHORIZATION header removed by apache
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
# Rewrite all other queries to the front controller.
RewriteRule .? %{ENV:BASE}/app.php [L]
RedirectMatch 302 ^/$ /app.php/