Make WordPress Core

Opened 17 months ago

Closed 6 months ago

#57986 closed enhancement (duplicate)

`got_url_rewrite` doesn't support Caddy V2

Reported by: sadpencil's profile sadpencil Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Permalinks Keywords:
Focuses: Cc:

Description

In Caddy V2, redirect about index.php file is automatically configured by default. However, wordpress does not detect Caddy in function got_url_rewrite so the permalink always has an 'index.php' in the middle.

See also: https://caddy.community/t/wordpress-pretty-permalinks-in-caddy-v2/18980/8

Change History (5)

#1 @sadpencil
17 months ago

Moreover, it could be better to provide a checkbox, allowing users to tell WordPress that it can assume redirects are applied without actually checking for it

#2 follow-up: @swissspidy
17 months ago

  • Version trunk deleted

Hi there and welcome to WordPress Trac!

How can WordPress detect whether the current web server is a Caddy server? Are there any functions it could check?

Moreover, it could be better to provide a checkbox, allowing users to tell WordPress that it can assume redirects are applied without actually checking for it

The got_url_rewrite filter is useful for this.

#3 in reply to: ↑ 2 @sadpencil
17 months ago

Replying to swissspidy:

Thanks for the response.

How can WordPress detect whether the current web server is a Caddy server?

$_SERVER['SERVER_SOFTWARE']

This string starts with 'Caddy/v2', e.g., 'Caddy/v2.6.4'

The got_url_rewrite filter is useful for this.

I know I can write a custom filter to override got_url_rewrite in my child theme's functions.php file. Just wondering if it is better to provide a checkbox in permalink page.

Last edited 17 months ago by sadpencil (previous) (diff)

#4 @cfinnberg
6 months ago

Hi, is there anything I (as a nobody :) ) can do to see Caddy support going forward? I noticed that there was already a request with a patch available a few years ago, but it just got forgotten.

Request: https://core.trac.wordpress.org/ticket/41877
Patch: https://core.trac.wordpress.org/attachment/ticket/41877/41877.patch

#5 @swissspidy
6 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #41877.

Let‘s close this one as a duplicate then & push the other one over the finish line.

Note: See TracTickets for help on using tickets.