Make WordPress Core

Opened 9 months ago

Closed 7 months ago

#63271 closed defect (bug) (invalid)

Multisite (Subdirectory) URL Corruption in Page Content (Language Site)

Reported by: nattila's profile nattila Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.7.2
Component: Networks and Sites Keywords:
Focuses: multisite Cc:

Description (last modified by sabernhardt)

  • WordPress Version: 6.7.2
  • Multisite: Enabled (Subdirectory installation)
  • Theme: Twenty Twenty-Five
  • Plugins: All plugins deactivated
  • wp-config.php: Default settings
  • .htaccess: Default settings

Site Structure: Main site (ID=1) at root, additional site (ID=X, e.g., 2) in subdirectory /hu/ (for Hungarian language).

Steps to Reproduce:

  • Create a new page or edit an existing page on the subdirectory site (/hu/).
  • Switch to the Code Editor.
  • Add an HTML link within the page content that points to a page on the same domain within the subdirectory site. Example: <a href="https://www.mydomain.io/hu/book-a-call/">link text</a>
  • Save the page.
  • Reload the editor page.
  • Check HTML of the link.

Expected Behavior:
The link should remain as entered.

Actual Behavior:
The URL is corrupted, with the subdirectory name being duplicated or altered. Example:
<a href="https://www.mydomain.iohuhu/hu/book-a-call/">link text</a>

Additional Information:

This issue only occurs on subdirectory sites within the Multisite environment.
Links to external domains (e.g., https://www.google.com) are not affected.
The main site (ID=1) is not affected.

Attachments (1)

test.png (70.7 KB) - added by nattila 9 months ago.

Download all attachments as: .zip

Change History (10)

@nattila
9 months ago

#1 @nattila
9 months ago

as I mentioned it happens if I add content in Code editor, or by using HTML blocks.

#2 @sabernhardt
9 months ago

  • Description modified (diff)

#3 @realloc
9 months ago

I tested this in a clean wp-env environment and couldn’t reproduce the issue. The editor saved the links correctly, so I think WordPress itself is not the cause of the problem. Since there were no plugins active and the default theme was used, the issue probably comes from outside WordPress.

The most likely causes are server settings or caching. Incorrect rewrite rules or proxies changing the request could create broken URLs. Also, caching systems or tools that optimize content might change or serve old HTML. Turning off these systems and checking how the content is saved and shown could help find the issue.

#4 @sabernhardt
9 months ago

#63270 mentions a similar link corruption, but the situation sounds very different.

#5 @nattila
9 months ago

Yes, it's somewhat the same because whenever I save content, the folder name is always added to the link. so after updating the content few times it looks like this: <a href="https://www.mydomain.iohuhuhuhuhuhuhuhu/hu/book-a-call/">link text</a>

Now I use relative URLs instead, which has 'solved' the issue. Relative links don't contain the domain or the site folder; therefore, the issue isn't triggered.

This ticket was mentioned in Slack in #core-multisite by realloc. View the logs.


7 months ago

#7 @Rahe
7 months ago

Hello,

I've tested this on local environment with your instructions, the url is not altered in any way too.
Frontend page url is correct too.

Like mentionned before, this seems like a process outside of WordPress is altering the link on save.

Do you have tested this without any plugins and default theme ?

Nicolas,

This ticket was mentioned in Slack in #core-multisite by rahe. View the logs.


7 months ago

#9 @johnbillion
7 months ago

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

Closing this off as nobody else has reproduced the issue, and it looks like this is either caused by a plugin on the site or a some other process outside of WordPress. Cheers!

Note: See TracTickets for help on using tickets.