[wp-trac] [WordPress Trac] #12175: Issues using mod_rewrite / mod_cache together (apache)

WordPress Trac noreply at wordpress.org
Fri Jul 19 08:41:16 UTC 2019


#12175: Issues using mod_rewrite / mod_cache together (apache)
--------------------------+--------------------------
 Reporter:  hurikhan77    |       Owner:  (none)
     Type:  defect (bug)  |      Status:  reopened
 Priority:  normal        |   Milestone:
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:  performance
--------------------------+--------------------------
Changes (by wasabi_flagg):

 * status:  closed => reopened
 * resolution:  wontfix =>


Comment:

 I tried to change "RewriteRule . /index.php [L]" into "RewriteRule ^(.*)$
 /index.php/$1 [L]"
 but Wordpress gives me "File not found" for every page but the homepage
 Apache 2.4.25
 Mod_Cache_Disk
 Php7-FPM
 Wordpress 5.2.2

 Replying to [ticket:12175 hurikhan77]:
 > We run several wordpress deployments on a server which also runs
 mod_cache for performance reasons. However, using wordpress supplied
 rewrite configuration creates unwanted caching artefacts in mod_cache
 because the default rewrite configuration rewrites ALL requests into a
 single URL instead of unique/canonical URLs. The problem is that mod_cache
 only sees the final rewritten URL upon caching which is obviously unique
 for all request. A simple change in htaccess however works around this
 problem:
 >
 > Change "{{{RewriteRule . /index.php [L]}}}" into "{{{RewriteRule ^(.*)$
 /index.php/$1 [L]}}}". It should not hurt the rest of the wordpress
 installation but allows for high performance reverse proxying of wordpress
 installations using mod_cache.
 >
 > I'm assigning this major severity as the original {{{RewriteRule}}} rule
 can lead to unwanted content disclosure and can result in wrong content
 for a URL being delivered.
 >
 > This bug triggers in mod_cache as soon as proper combinations of HTTP
 caching headers are sent (Expires, Cache-Control, etc). However, it will
 not trigger in default apache (read "non-mod_cache") configurations, only
 when you apply high-performance content caching configurations within
 apache in combination with mod_rewrite.

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


More information about the wp-trac mailing list