1. Caddy version (caddy version
):
v2.2.1 h1:Q62GWHMtztnvyRU+KPOpw6fNfeCD3SkwH7SfT1Tgt2c=
2. How I run Caddy:
Caddy run on a server in the cloud behind cloudflare serving xenforo forums software
a. System environment:
Ubuntu Server 20.04
b. Command:
sudo systemctl start caddy
c. Service/unit/compose file:
N/A
d. My complete Caddyfile or JSON config:
{
experimental_http3
}
www.example.com, example.com {
file_server
root * /var/www/example.com/html/
import /etc/caddy/caddy_security.conf
log {
output file /var/log/caddy/example.com.access.log {
roll_size 3MiB
roll_keep 5
roll_keep_for 48h
}
format console
}
encode gzip zstd
php_fastcgi unix//run/php/php7.4-fpm.sock
tls /etc/caddy/ssl/certs/certificate.pem /etc/caddy/ssl/private/key.pem {
protocols tls1.2 tls1.3
client_auth {
mode require_and_verify
trusted_ca_cert_file /etc/caddy/ssl/certs/origin-pull-ca.pem
}
}
}
3. The problem I’m having:
I’m trying to convert a .htaccess file provided by Xenforo that allows for “friendly URL’s”, i.e. doesn’t display the index.php file, but rather the path to the folder containing it.
4. .htaccess file details:
# Mod_security can interfere with uploading of content such as attachments. If you
# cannot attach files, remove the "#" from the lines below.
#<IfModule mod_security.c>
# SecFilterEngine Off
# SecFilterScanPOST Off
#</IfModule>
ErrorDocument 401 default
ErrorDocument 403 default
ErrorDocument 404 default
ErrorDocument 405 default
ErrorDocument 406 default
ErrorDocument 500 default
ErrorDocument 501 default
ErrorDocument 503 default
<IfModule mod_rewrite.c>
RewriteEngine On
# If you are having problems with the rewrite rules, remove the "#" from the
# line that begins "RewriteBase" below. You will also have to change the path
# of the rewrite to reflect the path to your XenForo installation.
#RewriteBase /xenforo
# This line may be needed to workaround HTTP Basic auth issues when using PHP as a CGI.
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>
5. Error messages and/or full log output:
No error messages to report, just need some assistance converting the .htaccess file
6. What I already tried:
Tried to port it myself to no avail. I appreciate any assistance anyone can provide here.
7. Links to relevant resources:
N/A