Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ DocumentRoot ${APACHE_DOCUMENT_ROOT}
DirectoryIndex index.php index.html index.htm
</Directory>

# Redirect /index.php/... to /... to prevent SEO duplicate content
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/index\.php/
RewriteRule ^/index\.php(/.+)$ $1 [R=301,L,QSA]

# Healthchecks: Set /healthcheck to be the healthcheck URL
ProxyPass "/healthcheck" "fcgi://localhost:9000"
ProxyPassReverse "/healthcheck" "fcgi://localhost:9000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ DocumentRoot ${APACHE_DOCUMENT_ROOT}
DirectoryIndex index.php index.html index.htm
</Directory>

# Redirect /index.php/... to /... to prevent SEO duplicate content
RewriteEngine On
RewriteCond %{THE_REQUEST} \s/index\.php/
RewriteRule ^/index\.php(/.+)$ $1 [R=301,L,QSA]

# Healthchecks: Set /healthcheck to be the healthcheck URL
ProxyPass "/healthcheck" "fcgi://localhost:9000"
ProxyPassReverse "/healthcheck" "fcgi://localhost:9000"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ location ~* ^/storage/.*\.php$ {
deny all;
}

# Redirect /index.php/... to /... to prevent SEO duplicate content
location ~ ^/index\.php(/.+)$ {
return 301 $1$is_args$args;
}

# Pass "*.php" files to PHP-FPM
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ location ~* ^/storage/.*\.php$ {
deny all;
}

# Redirect /index.php/... to /... to prevent SEO duplicate content
location ~ ^/index\.php(/.+)$ {
return 301 $1$is_args$args;
}

# Pass "*.php" files to PHP-FPM
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
Expand Down
4 changes: 4 additions & 0 deletions src/variations/frankenphp/etc/frankenphp/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@
}
log_skip @healthcheckpath

# Redirect /index.php/... to /... to prevent SEO duplicate content
@indexphp path_regexp indexphp ^/index\.php(/.+)$
redir @indexphp {re.indexphp.1} 301

php_server {
{$CADDY_PHP_SERVER_OPTIONS}
}
Expand Down