1. CONFIGURATION
Caddy version 2 , Installed on CentOS v7, used to serve multpile wordpress sites/installations (each in a webroot subdir), Wordpress v5.6.2
2 GOAL
Remove the “/index.php/” string from URLs , possibly using the standard “custom permalink setup” in each Wordpress admin dashboard.
3 CURRENT SOLUTION
With the attache Caddyfile, the /index.php/ string is removed from the root served web only, but NOT from the inner websites.
Caddy documentation is not clear about using caddyfile when multiple sites are served, and I did not find a similar case on this forum, so I need your help.
4 CURRENT CADDYFILE
mysite.com , www.mysite.com {
tls /etc/certificates/chain.pem /etc/certificates/key.pem
root * /var/www/wordpress
php_fastcgi 127.0.0.1:9000
file_server
encode gzip
@disallowed {
path /xmlrpc.php
path *.sql
path /wp-content/uploads/*.php
}
}
mysite.com/innerweb , www.mysite.com/innerweb {
tls /etc/certificates/chain.pem /etc/certificates/key.pem
root * /var/www/wordpress/innerweb
php_fastcgi 127.0.0.1:9000
file_server
encode gzip
@disallowed {
path /xmlrpc.php
path *.sql
path /wp-content/uploads/*.php
}
}
I tried using the URI and REWRITE Directive, with no success - I’m not expert in Regex, and probably missing the correct syntax and behind-the-scenes caddyfile interpretation by the caddy server
#uri replace /innerweb/ /innerweb/index.php/
#rewrite not path /innerweb/wp-admin /innerweb/* /innerweb/index.php/
#rewrite /innerweb/* /innerweb/index.php?{query}
#rewrite /innerweb/index.php/* /innerweb/index.php?{query}
#uri replace /innereb/index.php/ /innerweb/index.php?{query}
5 Resources:
https://denbeke.be/blog/servers/caddy-server-and-wordpress-php-fpm/
I would be very grateful for any help and hint, thank you
Leo