Hey all, I have a question about the htaccess that ships in latest Blesta (4.12.2).
On a correctly configured Ubuntu 20.04 apache server, we're seeing a bunch of 404s on all pages.
I'm wondering if something has changed in 20.04 because the exact same htaccess configuration works fine in Ubuntu 18.04.
In the site in question, Blesta is configured to run in /public_html/. There is nothing else on the server. No other directories except Blesta are contained in public_html.
However the site is a subdomain (blesta.domain.com) by A-record.
With htaccess deleted, all URLs on site load normally with /index.php.
When the shipped htaccess is uploaded (to try to remove index.php), 404 error occurs on all pages except the public_html root which loads fine.
- PHP Version 7.4.3
- Apache/2.4.41 (Ubuntu)
- Site is using lets encrypt which has inserted ReWriteEngine On into the httpd.conf file (see below)
- Module rewrite is enabled
- cache/1/ is deleted
- Apache status is normal.
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerName blesta.domain.com
ServerAlias www.blesta.domain.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/blesta.domain.com/public_html/
<Directory /var/www/html/blesta.domain.com/public_html/>
Options +FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</Directory>
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog /var/www/html/blesta.domain.com/logs/error.log
CustomLog /var/www/html/blesta.domain.com/logs/access.log combined
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
RewriteEngine on
RewriteCond %{SERVER_NAME} =blesta.domain.com [OR]
RewriteCond %{SERVER_NAME} =www.blesta.domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Here's a copy of the htaccess file (from 4.12.2) that I uploaded to public_html:
########################################################
# package: minPHP
# filename: .htaccess
########################################################
# Do not allow direct access to templates
# or an unauthorized backdoor from CE
<Files ~ "blesta2ce.php|\.(pdt)$">
order deny,allow
deny from all
</Files>
# Protect against Clickjacking
#Header append X-Frame-Options "SAMEORIGIN"
RewriteEngine on
# Disable Apache MultiViews since it
# may conflict with the GUI installer
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
# Force HTTPS
#RewriteCond %{HTTPS} !=on
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=307,NE,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php
RewriteCond %{REQUEST_URI} ^(.*)/install.php$
RewriteRule install.php %1/install/ [R=301,L]
I don't think anything needs to be changed in the shipped htaccess.
Can anyone give a hint please what could be modified in the httpd.conf or something else to get the URLs to load normally using the above htaccess file?
Question
Tunde
Hey all, I have a question about the htaccess that ships in latest Blesta (4.12.2).
On a correctly configured Ubuntu 20.04 apache server, we're seeing a bunch of 404s on all pages.
I'm wondering if something has changed in 20.04 because the exact same htaccess configuration works fine in Ubuntu 18.04.
In the site in question, Blesta is configured to run in /public_html/. There is nothing else on the server. No other directories except Blesta are contained in public_html.
However the site is a subdomain (blesta.domain.com) by A-record.
With htaccess deleted, all URLs on site load normally with /index.php.
When the shipped htaccess is uploaded (to try to remove index.php), 404 error occurs on all pages except the public_html root which loads fine.
- PHP Version 7.4.3
- Apache/2.4.41 (Ubuntu)
- Site is using lets encrypt which has inserted ReWriteEngine On into the httpd.conf file (see below)
- Module rewrite is enabled
- cache/1/ is deleted
- Apache status is normal.
Here's a copy of the htaccess file (from 4.12.2) that I uploaded to public_html:
I don't think anything needs to be changed in the shipped htaccess.
Can anyone give a hint please what could be modified in the httpd.conf or something else to get the URLs to load normally using the above htaccess file?
Incidentally, the LAMP Ubuntu 20.04 server was installed using Tasksel and this DO tutorial: https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-20-04
Any help appreciated.
Cheers Tunde
2 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.