Make WordPress Core

Opened 15 months ago

Closed 15 months ago

Last modified 15 months ago

#60884 closed enhancement (fixed)

Caddy server / FrankenPHP got_url_rewrite support

Reported by: stephenmiracle's profile stephenmiracle Owned by: swissspidy's profile swissspidy
Milestone: 6.6 Priority: normal
Severity: normal Version:
Component: Permalinks Keywords: has-patch commit
Focuses: Cc:

Description

Caddy + FrankenPHP officially supports url rewriting, but it doesn't show in WordPress permalinks due the logic in this function: got_url_rewrite. I had to create a mu plugin to get the permalink backend to show as expected (removing index.php) by creating a filter.

I would like to extend this function to allow for this setup by explicitly checking for Caddy or checking for a server value that we can set.

right now, it checks for $_GLOBALSis_nginx? or $_SERVER values in iis7 function. I'd like to see a $_SERVERhas_rewrite? flag that I can set in Caddy or add a flag for $_SERVER[SERVER_SOFTWARE] => FrankenPHP .

I have created a sample branch of my own that could implement either and would be willing to submit for review

Thanks.

Change History (6)

#1 @swissspidy
15 months ago

  • Component changed from General to Permalinks
  • Focuses php-compatibility removed
  • Keywords reporter-feedback added

Caddy support was added in r57612, which is in 6.5. Is anything else needed?

#2 @stephenmiracle
15 months ago

Ok great. So will be available in the soon upcoming release.

I took a review and this will work for Caddy but not FrankenPHP (which is built and dependent on top of Caddy). It updates the value to be "FrankenPHP" . You could consider updating vars.php to

str_contains( $_SERVER['SERVER_SOFTWARE'], 'Caddy' ) || str_contains( $_SERVER['SERVER_SOFTWARE'], 'FrankenPHP' )

This ticket was mentioned in PR #6351 on WordPress/wordpress-develop by @swissspidy.


15 months ago
#3

  • Keywords has-patch added

#4 @swissspidy
15 months ago

  • Keywords commit added; reporter-feedback removed
  • Milestone changed from Awaiting Review to 6.6

Great, that sounds reasonable!

#5 @swissspidy
15 months ago

  • Owner set to swissspidy
  • Resolution set to fixed
  • Status changed from new to closed

In 57923:

Permalinks: Detect FrankenPHP web server support.

Support pretty permalinks when FrankenPHP server is detected, which is built on top of Caddy. Caddy detection was added in [57612].

Props swissspidy, stephenmiracle.
Fixes #60884.

Note: See TracTickets for help on using tickets.