diff options
Diffstat (limited to 'server/etc/apache.conf.tmpl')
-rw-r--r-- | server/etc/apache.conf.tmpl | 52 |
1 files changed, 45 insertions, 7 deletions
diff --git a/server/etc/apache.conf.tmpl b/server/etc/apache.conf.tmpl index edb3fda8..099d9ea5 100644 --- a/server/etc/apache.conf.tmpl +++ b/server/etc/apache.conf.tmpl @@ -21,12 +21,50 @@ RewriteEngine On AddType octet/stream .pkg </Directory> +Alias /opengnsys3 CONSOLEDIR3 + +# Redirect HTTP to HTTPS and default configuration. +<Directory CONSOLEDIR3> + 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 +</Directory> + # Redirect HTTP to HTTPS and RESTful configuration. -<Directory CONSOLEDIR/rest> - RewriteBase /opengnsys/rest/ - 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] +<Directory CONSOLEDIR3/backend/web> + #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 + + <IfModule mod_rewrite.c> + 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] + </IfModule> + + <IfModule !mod_rewrite.c> + <IfModule mod_alias.c> + RedirectMatch 302 ^/$ /app.php/ + </IfModule> + </IfModule> </Directory> |