Hi.
Problem Description
I’m trying to setup a website that should be directed to an index.php
but constantly gets directed to an index.html
.
Steps to Reproduce
- Create website folder and files under
/var/www/mysite.com/public_html
→ grant apache ownership - Create and enable apache configuration with following and successfully get letsencrypt certificate
Define servername mysite.com
<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.mysite.com
Redirect / https://mysite.com
</VirtualHost>
<VirtualHost *:443>
ServerName mysite.com
ServerAlias www.mysite.com
ServerAdmin myemail.com
DocumentRoot /var/www/mysite.com/public_html
<Directory /var/www/mysite.com/public_html>
Options -Indexes +FollowSymLinks
AllowOverride All
</Directory>
ErrorLog ${APACHE_LOG_DIR}/mysite.com-error.log
CustomLog ${APACHE_LOG_DIR}/mysite.com-access.log combined
SSLCertificateFile /etc/letsencrypt/live/mysite.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/mysite.com/privkey.pem
</VirtualHost>
- Open any browser and go to
https://mysite.com
→ goes tohttps://mysite.com/index.html
and turns out unreachable - Change address to
https://mysite.com/index.php
→ site works successfully
Expected Outcome
When I use my browser to https://mysite.com, I shouldn’t have to add index.php at the end. Instead I would like to make use of DirectoryIndex
for apache to point to .php
if .html
is not found.
Suggestion
I beleve the cause is /etc/apache2/conf-enabled/freedombox-apache-homepage.conf
RedirectMatch "^/$" "/index.html"
is overriding any attempt I make in apache reaching an index.php file if it cant find a index.html.
Request for Help
I would appreciate if anyone can help me solve this issue without braking the Plinth interface.
Information
- FreedomBox version: 23.6
- Hardware: Pi4 - arm64
- How did you install Fre.edomBox?: installed fbx on top of debian image for pi
Thanks everyone