All sites using a domain can't use customize feature

So...as I have been exploring the new domain mapping further, there are HUGE BUGS that need to be addressed ASAP as the plugin breaks site functionalities. The default set up of "directed to mapped (primary) domain" isn't working, with a multi-site network with https enabled, here's why:

SENERIO 1:

https://networkname.com/subblogname/wp-admin/customize.php?url=http%3A%2F%2Fwww.subblogdomain.com%2F

This will cause a blank screen. This is how most people will attempt to access the customize feature because they wont be able to visit it via http://networkname.com/subblogname/ because that will forward to their domain

SENARIO 2:

User goes to: https://networkname.com/subblogname/ that will then forward to https://subblognamedomain.com/ which when https is not set up for that domain throws an error.

The proper functionality (as you had it originally) was to not have https://networkname.com/subblogname/ forward to https://subblognamedomain.com/ and instead just have it ignore the forward and instead have it only forward when visiting http://networkname.com/subblogname/ like it did before.

A work around is to have customers choose "disabled and entered domain should be used" however there is not mention of that feature after the domain has been added making it very difficult for customers to figure out to delete the domain for the non-forwarding.

Anyways...it would be very helpful if these things were addressed soon as they are causing a lot of confusion from a customer sub-blog prospective.

  • Michael Bissett

    Hey @Ben, hope you're doing well this evening! :slight_smile:

    For scenario #1, inside the Network Dashboard, if you go:

    Settings -> Domain Mapping

    Have you tried setting "Administration mapping" to "original domain"?

    For scenario #2, I'm curious, I'm not seeing that HTTPS is being forced inside of Domain Mapping presently, are you using a different method to handle that? Or did you disable it for the time being?

    Please advise,
    Michael

  • Timothy Bowers

    Hey Ben,

    >> Have you tried setting "Administration mapping" to "original domain"?
    I have it set that way :slight_smile: Senario #1 seems to have gone away...not sure why.

    Glad that's gone away :slight_smile:

    I'd need to see the error logs for the site to know what caused it, there would be a fatal error in there. If you're using HTTPS, you'd only want to use the original domain as that's the only one with a valid cert.

    I think by you not using the URLs in this post you don't want to divulge site names or sub site links. I'll refer to them by site ID, you can see the site ID by:

    Admin --> Network --> Sites

    Hover over the edit (see screenshot) or click edit and see the URL field for the ID.

    When I go to site ID 11, I see the grey site, IMDB link on the top right. It looks like a normal site and the domain is mapped with a www. I checked around the admin, I didn't see any linking to the front end using https. Linking to the front end is all for the www address so it works as expected.

    I guess what you're seeing is that someone manually edits the URL to remove the /wp-admin/ and thus get the https://networkname.com/subblogname/ url?

    I'd imagine normal members, especially those not familiar with WordPress would just use the links to navigate?

    Anyway I was testing and see this:

    http://domain.com/subsite/ = http://subsite.com/

    But:

    https://domain.com/subsite/ = http://domain.com/

    As I said though, the expected user behaviour is to click around, so the mass amount of users shouldn't hit this issue. Or did you see some linking to the https frontend somewhere?

    I'm going to ask our second level support (SLS) to take a quick peek at this one.

    Take care.

  • Jose

    Hi there Ben,

    Hope you are doing great.

    I was looking into your site and I would need some clarification:
    1- On front end, you want HTTP request to be mapped but HTTPS to use the domain entered by the user? Or are you trying to force both HTTP and HTTPS to use always the mapped domain over HTTP?
    2- You said:

    User goes to: https://networkname.com/subblogname/ that will then forward to https://subblognamedomain.com/ which when https is not set up for that domain throws an error.

    I don't see an error. Instead, I'm being redirected to https://networkname.com/. Is this some redirection that you added as a workaorund?

    Please advise.

    Also, in order to win some time, it would be great if you could send us the following information via contact form :

    - In the subject field add "Attn: Jose”
    - Link back to this thread
    - Include WP admin/network access
    - Include FTP host and credentials.

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    Thanks in advance,
    Jose

  • Ben

    @Jose

    Just noticed while testing you must have set the following setting in:

    wp-admin/network/settings.php?page=domainmapping_options
    Would you like to force https in login and admin pages:
    YES

    Would you like to force http/https in front-end pages:
    FORCE HTTP

    Making those settings made it so that the customize feature was blocked, I created a thread for that:

    https://premium.wpmudev.org/forums/topic/having-trouble-getting-customize-feature-to-workwas-just-working-a-few-days-ago#post-855000

    Now that i switched the settings back to my original of:
    Would you like to force https in login and admin pages
    NO
    and
    Would you like to force http/https in front-end pages:
    NO

    The customize section now works with me changing those settings back to the original. However this reveals a new bug in the domain mapping system that needs to be addressed. Vaughn closed that thread and mistakenly assumed it was related to the other thread, but its not...

    Or are you trying to force both HTTP and HTTPS to use always the mapped domain over HTTP

    Previously with the exact same settings, https://networkname.com/subblog would NOT be forced to mappeddomain.com, however the Http://networkname.com/subblog would be forced to mapped domain. I would have loved for that logic to remain.

    I don't see an error. Instead, I'm being redirected to https://networkname.com/.

    I am assuming you meant to say you are redirected to: https://mappeddomain.com/

    And that is the error as my mapped domain is not HTTPS it is instead HTTP. This is all regarding sub-blogs.

  • Jose

    @Ben,

    I am assuming you meant to say you are redirected to: https://mappeddomain.com/

    No, I mean https://networkname.com/.
    For instance, for your subblog with ID 11, the original url:
    https://a.......r.com/d.......n/
    Will redirect to:
    https://a.......r.com/

    In any case, it would be great if you can send me the credentials requested above.
    That way we can also follow the conversation in private and be more specific since we can not reveal urls here and that can lead to confusions.

    Cheers,
    Jose

  • Jose

    Hey Ben,

    I sent you an email explaining the issue.

    Will add some info here in case someone runs into the same situation.

    I can't find a reason to explain why previous version worked as you describe. The schema field indicates only to which protocol you are willing to force the redirect. But it doesn't mean that https will not be redirected if you select http.

    Nevertheless, the plugin provides a hook to avoid SSL original domain to be mapped. Adding the following to your theme's functions.php should do the trick:
    add_filter('dm_prevent_redirection_for_ssl', '__return_true':wink:;

    Also, there is a confusion in regard to what you mentioned in the thread:

    A work around is to have customers choose "disabled and entered domain should be used" however there is not mention of that feature after the domain has been added making it very difficult for customers to figure out to delete the domain for the non-forwarding.

    Actually, it is in deed very confusing due to a weird UI layout.( I was confused the same as you ).
    You can change this setting whenever you want from the dropdown selector. This is a general setting for the subsite (it is not for each mapped domain) and will be saved automatically via ajax every time you change the option in the selector. (see image attached)

    Please let me know if this works fine for you.

    Cheers,
    Jose

  • Jose

    Hi Ben,

    I will try that...but everytime a theme is updated I will have to re-add this...which kinda sucks.

    Instead of adding the code to the theme, you can use it in a Must-Use plugin.
    I took the time to wrap the code for you. You only need to download the attached file and drop the contained .php file into the folder ../wp-content/mu-plugins/ (create the folder if it doesn't exists).

    Regarding the options that you are not seeing in your site, I just realized what the issue is. Those options are only visible when multiple domains are allowed. (except the 'edit' icon, that's just a prototype that I'm developing).

    Please go to the file ../wp-content/plugins/domain-mapping/domain-mapping.php line 38 and uncomment the following line:
    define('DOMAINMAPPING_ALLOWMULTI', 'yes');
    I think that the 'Front end redrect' dropdown menu should remain visible for single mapping as well. I'll discuss this with the lead developer.

    For the other behaviour that you mention, I would need to look directly in your install. There might be another plugin causing the redirection.
    In order to do this, I would need the credentials requested above.

    Please keep me posted on how it goes. :slight_smile:

    Cheers,
    Jose

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.