[wp-trac] [WordPress Trac] #52969: Permalink for /wp-includes falls back to blog post

WordPress Trac noreply at wordpress.org
Mon Apr 5 09:39:45 UTC 2021

#52969: Permalink for /wp-includes falls back to blog post
 Reporter:  fancsali      |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  5.6.1
 Severity:  normal        |   Keywords:
  Focuses:                |
 After setting up WordPress, and enabling pretty looking permalinks, I
 found something odd happening.

 The Apache rewrite rules have been also set up in the VHost config:

 ServerName example.com

 DocumentRoot /usr/share/wordpress
 Alias /wp-content /var/www/example.com/wp-content

 RewriteEngine On

 RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

 RewriteRule ^index\.php$ - [L]
 RewriteCond /usr/share/wordpress%{REQUEST_URI} !-f
 RewriteCond /usr/share/wordpress%{REQUEST_URI} !-d
 RewriteCond /var/www/example.com%{REQUEST_URI} !-f
 RewriteCond /var/www/example.com%{REQUEST_URI} !-d
 RewriteRule . /index.php [L]

 # Directory permissions omitted

 '''Note''': I have the (shared) code in `/usr/share/wordpress` and the
 actual ''site-specific'' content in `/var/www/<domain-name>` so I can host
 several sites with the same WP installation.

 So, everything seems fine and dandy, until Chrome tries to load some
 `.js.map` files, which will raise a warning in the browser console:
     DevTools failed to load SourceMap: Could not parse content for
 https://example.com/wp-includes/js/underscore.min.js.map: Unexpected token
 < in JSON at position 0

 Having a look into the issue, I found, that most of the non-existent files
 will correctly return a 404 (as before the permalinks), however anything
 below `/wp-includes/js/` will fall back to my first blog post. (So
 `https://7c00.io/wp-includes/js/foo/` will also show my "hello-world" test

 As due the rewrite rules everything is essentially handled by PHP, I
 suspect this is an issue with the WP permalinks business logic.

Ticket URL: <https://core.trac.wordpress.org/ticket/52969>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform

More information about the wp-trac mailing list