[wp-trac] [WordPress Trac] #20746: Accessing non-existing theme folder in Network install gives 500 error

WordPress Trac noreply at wordpress.org
Sun Jul 10 00:23:55 UTC 2016


#20746: Accessing non-existing theme folder in Network install gives 500 error
-------------------------------------+-----------------------------
 Reporter:  arkimedia                |       Owner:
     Type:  defect (bug)             |      Status:  reopened
 Priority:  normal                   |   Milestone:  Future Release
Component:  Rewrite Rules            |     Version:  3.3.2
 Severity:  normal                   |  Resolution:
 Keywords:  needs-testing has-patch  |     Focuses:  multisite
-------------------------------------+-----------------------------
Changes (by thomaswm):

 * keywords:  needs-testing needs-patch => needs-testing has-patch


Comment:

 Replying to [comment:28 jeremyfelt]:
 > Overall - I think it would be appropriate to avoid loading the entire
 WordPress 404 process for missing static files. My Apache rewrite memories
 have mostly been lost to Nginx rules. Any ideas on how that could be
 handled?

 I've come up with a pretty simple solution to this. See
 [attachment:20746.2.patch]. I've only added one line to my .htaccess file:
 {{{
 RewriteRule ^wp-(admin|content|includes) - [L]
 }}}

 That line ensures that request URIs starting with `/wp-content`, `/wp-
 admin` or `/wp-includes` are handled by Apache without loading WordPress.

 After adding that one line to my .htaccess file, I see the following
 behaviour:
 * For `http://foo.bar/subsite/non-dir/`, the server responds with a
 '''WordPress 404'''.
 * For the following three requests, the server responds with an '''Apache
 404 Not Found'''.
  * `http://foo.bar/subsite/wp-content/non-dir/`
  * `http://foo.bar/subsite/wp-content/non-file.txt`
  * `http://foo.bar/subsite/wp-content/non-dir/non-file.txt`

--
Ticket URL: <https://core.trac.wordpress.org/ticket/20746#comment:36>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list