WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 3 years ago

#35558 closed defect (bug) (fixed)

Multiple WP sites in subfolders on IIS may break permalinks

Reported by: WiZZarD_ Owned by: johnbillion
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Rewrite Rules Keywords: has-patch needs-refresh
Focuses: Cc:

Description

When installing WP in a subfolder of an existing blog you will end up breaking the site in the subfolder after enabling permalinks. This is caused by a duplicate name in the rewrite rule for the different folders. The easiest way to fix this would be to change the rule name by adding a site-specific identifier.

I've added a patch that uses get_bloginfo( 'wpurl' ) to create a unique identifier. Also, I've corrected the capitalization of WordPress, since it was all lowercase.

Attachments (2)

class-wp-rewrite.patch (428 bytes) - added by WiZZarD_ 3 years ago.
patch for class-wp-rewrite.php
class-wp-rewrite.2.patch (409 bytes) - added by WiZZarD_ 3 years ago.

Download all attachments as: .zip

Change History (9)

@WiZZarD_
3 years ago

patch for class-wp-rewrite.php

#1 @johnbillion
3 years ago

  • Keywords has-patch needs-testing added
  • Version trunk deleted

#2 @Ixium
3 years ago

  • Keywords needs-testing removed

Works like a charm. After deleting the existing web.config and applying the patch, the correct web.config is written when setting a new-permalink structure.

This ticket was mentioned in Slack in #core by wizzard. View the logs.


3 years ago

#4 @johnbillion
3 years ago

  • Keywords needs-refresh added
  • Milestone changed from Awaiting Review to 4.5

Thanks for the patch, @WiZZarD_ (and welcome to WordPress Trac).

A slight improvement would be to use "WordPress: ' . home_url() . '" to avoid using any natural language, and to use the newer home_url() function which is now preferred over get_bloginfo(). Apart from that, this change makes sense.

This ticket was mentioned in Slack in #core by chriscct7. View the logs.


3 years ago

#6 @chriscct7
3 years ago

  • Owner set to johnbillion
  • Status changed from new to assigned

#7 @johnbillion
3 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 36953:

Rewrite Rules: Allow rewrite rules to work in nested WordPress installations on IIS.

Props WiZZarD_
Fixes #35558

Note: See TracTickets for help on using tickets.