Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#52969 new defect (bug)

Permalink for /wp-includes falls back to blog post

Reported by: fancsali's profile fancsali Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 5.6.1
Component: Rewrite Rules Keywords:
Focuses: Cc:


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:


DocumentRoot /usr/share/wordpress
Alias /wp-content /var/www/

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/{REQUEST_URI} !-f
RewriteCond /var/www/{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 files, which will raise a warning in the browser console:

DevTools failed to load SourceMap: Could not parse content for 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 will also show my "hello-world" test post)

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

Change History (2)

#1 @fancsali
3 years ago

Checked another few URLs, and the issue seems to be present for other URLs too, for example:

  • ...

#2 @SergeyBiryukov
3 years ago

  • Component changed from General to Rewrite Rules
Note: See TracTickets for help on using tickets.