Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 4 years ago

#23478 closed defect (bug) (wontfix)

Impossible to view posts titled "WP Content" or "WP Includes" with some forms of permalinks

Reported by: kjasdu's profile kjasdu Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords: close
Focuses: Cc:

Description

Posts titled "WP Content" or "WP Includes" (without quotes) are impossible to view when using the following forms of permalinks:

  1. /%postname%
  2. /%postname%/

A post titled "WP Content" will have a permalink of either http://example.com/wp-content or http://example.com/wp-content/, both will show a blank page.

A post titled "WP Includes" will have a permalink of either http://example.com/wp-includes or http://example.com/wp-includes/, both will show the directory index of the wp-includes directory.

WordPress should either:

a) make it possible to view both posts normally

b) warn the user or make it not possible to have a combination of some post titles and some certain forms of permalink.

Change History (8)

#1 @kovshenin
12 years ago

  • Cc kovshenin added

Since wp-content and wp-includes are real directories, the web server will not rewrite their names to index.php. This is also true for wp-admin and other funky permalinks + slugs combinations could be made up to conflict with other actual files. It's an edge case and might be possible to work around this by installing WordPress in its own directory.

#2 @mark-k
12 years ago

  • Keywords close added

This is not a bug in wordpress as wordpress doesn't even get control from apache when you access those URLS. You can use different slugs for the posts, or move the wordpress installation to a different directory http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory.

b) warn the user or make it not possible to have a combination of some post titles and some certain forms of permalink.

Wordpress is not notified in any way when there are changes to the server, so even if at one point in time a.com/wp-content worked, there is no guaranty it will keep working forever.

#3 @nacin
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

#4 @SergeyBiryukov
9 years ago

#34100 was marked as a duplicate.

#5 @swissspidy
8 years ago

#36245 was marked as a duplicate.

#6 @SergeyBiryukov
8 years ago

wp_unique_post_slug() could probably check if a real directory or file exists with the same name and use a suffix like wp-admin-2 in that case, but I agree with comment:1 that it's an edge case. A simple workaround is to edit the slug manually.

#7 @SergeyBiryukov
4 years ago

#52118 was marked as a duplicate.

#8 @SergeyBiryukov
4 years ago

As noted in #52118, this also affects wp-json.

Note: See TracTickets for help on using tickets.