[Domain Mapping] Subsites are redirecting to main site

Recently sites with mapped domains have started to redirect to main site, keeping the path part of the URL intact.

  • Nithin

    Hi Todd,

    It seems like the support access to your website is no longer enabled, could you please enable support access, so that we could check the dashboard side to have a better idea about how the plugin is configured, and give a closer look at what could be causing this.

    You can grant access from WPMU DEV > Support > Support Access > Grant Access, or check this manual: https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-5

    Please let us know once you enable access so that we could get this sorted. Have a nice day. :slight_smile:

    Kind Regards,

  • Todd

    Support access is granted and the support rep that posted this topic worded it a bit wrong.

    Here's the scenario:
    Original domain: abc.domain.com/johndoe
    Mapped domain: johndoe.com

    The main issue is that when visiting the original domain, it used to automatically redirect to the mapped domain. Now it still does the redirect, the only issue is that it adds the subfolder slug with the redirect causing a 404 (ie johndoe.com/johndoe instead of johndoe.com as it used to be). Please let me know if you notice any issues with access or any other mods that may need to be done on my end to solve this issue.

  • Nithin

    Hi Todd,

    I could notice the issue on your website. However, I wasn't able to access the subsite dashboard as it was getting redirected to a login screen.

    I had to create a super admin account(wpmutest) so I could access the subsite dashboard and check further on how the subsite dashboard was mapped within the original domain URL. I hope you don't mind that. The account has been deleted once the test was done quickly asap.

    Unmapping, purging cache, and re-mapping the website in the subsite dashboard side has resolved the issue. Now, I don't see any redirections when accessing the original domain URL.

    Please do clear the browser cache, and check how it behaves in your website side, and let us know if you have further query.

    Kind Regards,

  • Nithin

    Hi Todd,

    The issue seems more related to a site-specific issue, as I'm not able to replicate such behaviour in my system when tested with the Domain Mapping plugin.

    I'm afraid, it's tough to say what could be causing, or provide a fix without replicating the issue in our side too. In general, this occurs due to a conflict with an existing plugin or due to some custom rules in htaccess.

    Could you please test by switching temporarily to default rules in htaccess, and check whether you notice a similar issue after that too?

    RewriteEngine On
    RewriteBase /
    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]

    If you still notice the same issue. Please check whether there are any common plugins in the subsites for the websites you notice such anomalies to rule and check whether it makes any difference once the plugins are deactivated.

    Also, in general when using Domain Mapping plugin, you don't have to change the Site, and Home URL to the mapped domain for the subsite, because the Domain Mapping plugin would be taking care of it programmatically. Maybe, that could also be affecting such anomalies after the update.

    That's once you edit the subsite under Sites > All Sites page in the network dashboard, under "Settings" tab, the Site, and Home URL can be the original subsite URL, instead of the mapped domain URL, and the Domain Mapping plugin would still work without any issue in such use case too.

    These are the points that could be looked upon, and most probably would give a better idea of what could be causing this. Please do check, and see how it goes, so that we could give a closer look if needed.

    Kind Regards,

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.