File tree Expand file tree Collapse file tree
fpm-apache/etc/apache2/vhost-templates
fpm-nginx/etc/nginx/site-opts.d
frankenphp/etc/frankenphp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,11 @@ DocumentRoot ${APACHE_DOCUMENT_ROOT}
1313 DirectoryIndex index.php index.html index.htm
1414</Directory>
1515
16+ # Redirect /index.php/... to /... to prevent SEO duplicate content
17+ RewriteEngine On
18+ RewriteCond %{THE_REQUEST} \s/index\.php/
19+ RewriteRule ^/index\.php(/.+)$ $1 [R=301,L,QSA]
20+
1621# Healthchecks: Set /healthcheck to be the healthcheck URL
1722ProxyPass "/healthcheck" "fcgi://localhost:9000"
1823ProxyPassReverse "/healthcheck" "fcgi://localhost:9000"
Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ DocumentRoot ${APACHE_DOCUMENT_ROOT}
1818 DirectoryIndex index.php index.html index.htm
1919</Directory>
2020
21+ # Redirect /index.php/... to /... to prevent SEO duplicate content
22+ RewriteEngine On
23+ RewriteCond %{THE_REQUEST} \s/index\.php/
24+ RewriteRule ^/index\.php(/.+)$ $1 [R=301,L,QSA]
25+
2126# Healthchecks: Set /healthcheck to be the healthcheck URL
2227ProxyPass "/healthcheck" "fcgi://localhost:9000"
2328ProxyPassReverse "/healthcheck" "fcgi://localhost:9000"
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ location ~* ^/storage/.*\.php$ {
3636 deny all;
3737}
3838
39+ # Redirect /index.php/... to /... to prevent SEO duplicate content
40+ location ~ ^/index\.php(/.+)$ {
41+ return 301 $1$is_args$args;
42+ }
43+
3944# Pass "*.php" files to PHP-FPM
4045location ~ \.php$ {
4146 fastcgi_pass 127.0.0.1:9000;
Original file line number Diff line number Diff line change @@ -42,6 +42,11 @@ location ~* ^/storage/.*\.php$ {
4242 deny all;
4343}
4444
45+ # Redirect /index.php/... to /... to prevent SEO duplicate content
46+ location ~ ^/index\.php(/.+)$ {
47+ return 301 $1$is_args$args;
48+ }
49+
4550# Pass "*.php" files to PHP-FPM
4651location ~ \.php$ {
4752 fastcgi_pass 127.0.0.1:9000;
Original file line number Diff line number Diff line change 5959 }
6060 log_skip @healthcheckpath
6161
62+ # Redirect /index.php/... to /... to prevent SEO duplicate content
63+ @indexphp path_regexp indexphp ^/index \.php(/.+)$
64+ redir @indexphp {re.indexphp.1} 301
65+
6266 php_server {
6367 {$CADDY_PHP_SERVER_OPTIONS}
6468 }
You can’t perform that action at this time.
0 commit comments