WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 4 months ago

#37201 new feature request

Allow access to .well-known prefix (RFC-5785) in default rewrite rules

Reported by: jakubboucek Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6
Component: Rewrite Rules Keywords: reporter-feedback close
Focuses: administration Cc:
PR Number:

Description

Automated configuration of rewrite in .htaccess ignore Well-Known Uniform Resource Identifiers (RFC-5785) defined in /.well-known/ prefix. This features can be designed outside of any Wordpress application (for example: Letsencrypt project is runned from server shell and puts static files to ./.well-known/ webroot as verification process during requesting HTTPS certificate). Default configuration of configuration of rewrite in .htaccess can thwart this process because it redirect to index.php.

I know its contentious PR, but current state make confusions on some webhostings.

My tip: Just add after this line new rule:
RewriteCond %{REQUEST_URI} !^/.well-known/

Change History (2)

#1 @Presskopp
3 years ago

Look what the drupal people do:
https://www.drupal.org/node/2408321

#2 @dd32
3 years ago

  • Keywords reporter-feedback close added

I'm not sure I see the need for this.

The default WordPress rules allow for a file that exists to take precedence over WordPress handling the request. WordPress will respond with a non-200 response for a request to one of these URLs in the event the file doesn't exist.

There's also the possibility (I think there exists at least one) plugin for WordPress which specifically DOES want to handle /.well-known/ urls.

Perhaps a better question is, @jakubboucek What does the lack of this rule currently cause issue with?
It looks like Drupals rules are by default blocking access to /.* directories, so their handling of it isn't exactly relevant.

Note: See TracTickets for help on using tickets.