Defective URLs always generated in Multisite

Hi Wizards...

URL generation in multisite went defective about a month ago as Domain Mapping began to include blog name in internally generated URLs.

Here is the video illustration of the bug:

This caused a great many internal links to become defective, including for graphics and internal editor resources. The defect applies to standard wp-content resources.

For example: show up as

This issue renders most console functions unusable.

Thanks in advance for the help.

  • Nithin
    • Support Wizard

    Hi Mark,

    Hope you are doing good today. :slight_smile:

    Thank you for sharing the video, I can confirm these issues. Did you perform plugin conflict test to make sure that there isn't any plugin conflict? Since I don't see you mention about performing a plugin conflict test, could you please run a quick plugin/theme conflict test as illustrated in getting support manual (flowchart), and rule out whether any plugin is causing this issue.

    Is this a live site? Is is okay, if we could deactivate some plugins, and check how your system responds. Please let us know that goes, so that we could give a closer look. Have a nice day. :slight_smile:

    Kind Regards,

  • squibm
    • Site Builder, Child of Zeus

    Hi. Nithin.
    Glad to have your help. We're stumped.
    0) All themes. plugins and wordpress are latest version
    1) We sequentially deactivated every plugin and tested to see if the issue went away, then reactivated each plugin. Presentation did not change regardless of activity with any plugin.
    2) We tested the issue on X-theme and graphene themes. The issue was consistent with each theme.
    3) Since the issue was consistent across themes, and within the wp-admin console, it seemed logical that the issue was primitive within wordpress.
    4) Your permission is set within the console. Go ahead and test the plugins. We were stumped.
    5) The site is live - but backed up.


  • Kasia Swiderska
    • Support nomad

    Hello squibm,

    I'm bit confused with situation on your website because I also have subdirectory multisite and all paths (to images, css, js files in front and in wp-admin) have included subsite name. And those paths are correct. I double checked with other staff member and that is correct setting.

    So reason why those images are not loading has to lay somewhere else.
    Would you mind showing your htaccess files? I'm asking for that because I recently checked site with similar issues and there was error in htaccess entry.

    kind regards,

  • squibm
    • Site Builder, Child of Zeus

    Here is the .htaccess file for the site.

    We have not suspected .htaccess because the change dates did not coincide with the appearance of the issue.
    Last recorded change - July 29, 2016
    Appearance of issue - October 29, 2016
    .htaccess datestamp Dec 7, 2016

    That said - I hope you're correct.

    Multiple uploads were un-cooperative. So here is the text.

    # Enable GZIP compression.
    <IfModule mod_deflate.c>
    # Compress HTML, CSS, JavaScript, Text, XML and fonts
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/
    AddOutputFilterByType DEFLATE application/x-font
    AddOutputFilterByType DEFLATE application/x-font-opentype
    AddOutputFilterByType DEFLATE application/x-font-otf
    AddOutputFilterByType DEFLATE application/x-font-truetype
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE font/otf
    AddOutputFilterByType DEFLATE font/ttf
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE image/x-icon
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/xml

    # Remove browser bugs (only needed for really old browsers)
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    Header append Vary User-Agent

    <IfModule mod_headers.c>

    # Send Access-Control-Allow-Origin header for Static CDN Filters.

    <FilesMatch "\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$">
    Header set Access-Control-Allow-Origin "*"

    # Cache-Control Headers

    <FilesMatch "\.(ico|jpe?g|png|gif|swf)$">
    Header set Cache-Control "public"

    <FilesMatch "\.(css)$">
    Header set Cache-Control "public"

    <FilesMatch "\.(js)$">
    Header set Cache-Control "private"

    <FilesMatch "\.(x?html?|php)$">
    Header set Cache-Control "private, must-revalidate"


    # Enable browser caching.
    FileETag mtime size

    # Enable Expirations
    <IfModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType audio/mpeg "access plus 1 month"
    ExpiresByType audio/mp3 "access plus 1 month"
    ExpiresByType video/mp4 "access plus 1 month"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"

    # Force a trailing slash on all virtual requests (except WP admin area).
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

    # If not a real file or directory.

    # Not a part of the WP admin area.

    # If there is no trailing slash.

    # Force a trailing slash on all virtual requests.
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !(?:^|/)wp\-admin(?:disappointed:|$)
    RewriteCond %{REQUEST_URI} !/$
    RewriteRule ^(.*)$ /$1/ [QSA,L,R=301]

    # 08/09/2016 -- CW
    # Disable xmlrpc after DDoS attacks
    <Files xmlrpc.php>
    Order Deny,Allow
    Deny from all

    Options -Indexes

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    SetEnvIfNoCase User-Agent "^$" bad_user
    SetEnvIfNoCase User-Agent "WinHttp.WinHttpRequest" bad_user
    Deny from env=bad_user

    # BEGIN WordPress

    RewriteRule ^index\.php$ - [L]

    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]

    RewriteRule ^([_0-9a-zA-Z-]+/)(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    # END WordPress

  • Nithin
    • Support Wizard

    Hey squibm,

    Hope you are doing good today. :slight_smile:

    This is really odd, if I hadn't missed out anything your .htaccess do look fine. Could you please send us your credentials so that we could give a closer look. You can send credentials by using our secure contact form:

    Select "I have a different question" for your topic.

    - To Mark to my attention, the subject line should contain only: ATTN: Nithin Ramdas
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Have a nice day. :slight_smile:

    Kind Regards,

  • Nithin
    • Support Wizard

    Hey squibm,

    Hope you are doing good today. :slight_smile:

    I gave a closer look, and it seems like the Force a trailing slash on all virtual requests rule was causing a conflict, in your .htaccess file. I have commented that part out, and your website seems to work fine in frontend, and all the issues with the backend also seems to be working fine now.

    As mentioned by Kasia, by default all the subsites in a multisite will have a path as follows: So, the template subsite will have /template path, and that would be how it functions.

    I have temporarily disabled the cache plugin, please clear your browser cache, and check whether it works fine, and please let us know if you still need any further assistance. Have a nice day. :slight_smile:

    Kind Regards,

  • Nithin
    • Support Wizard

    Hey squibm,

    Hope you are doing good today. :slight_smile:

    Thank you for the kind gesture, but we don't accept any personal offers, I'm glad that the issue is resolved. With the trailing slash issue, by default my multisite loads with a slash in every instance, it's odd that the your website isn't loading in such way. I checked your website, and if I hadn't missed out anything, I could see that your subsites, and pages do load with a trailing slash. I guess, you have figured it out?

    If not, if you still think there is an issue, would recommend you to create a new thread so that one of the support staff could get back to you asap. Have a nice day. :slight_smile:

    Kind Regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.