WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Post Preview does not work (34 posts)

  1. iffiliate
    Member
    Posted 3 years ago #

    Hi,

    I have a lot of WPMU Blogs and they all work fine. But today I noticed, that the Post Preview will not work with activated WPMU Domain Mapping Plugin. If I deactivate the Plugin, it works just fine.

    When I push the button "Preview" it will open a new tab with the url of the post and appended "?preview=true".

    Can you please fix the problem?

    Thanks a lot.

    Best regards.

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    If you are using the WPMU DEV domain mapping plugin then you get your support from them as well. This tag is for http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  3. iffiliate
    Member
    Posted 3 years ago #

    I did not use the DEV domain mapping plugin.

  4. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    Are you still running WordPress MU?

  5. enrican1976
    Member
    Posted 3 years ago #

    The same problem, MU mapping domain with options 2,3,4 activated don't show the preview of the posts.

    The problem is this:

    1) If I change on network admin > sites the name of blogs for example like this: myblogname.com

    After I'm not able to login on the admin panel of the blog.

    2) If I leave on network admin > sites the name of blogs for example like: blog.mainsite.com

    After I'm not able to see post preview.

    In both way people that use MU mapping domain will have issues.

    How is possible to fix the problem?

  6. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    The same problem, MU mapping domain with options 2,3,4 activated don't show the preview of the posts.

    I tried it with only those checked and post preview works for me. Try removing/deactivating all your other plugins and leave the site URL as the original URL that site had when you created it.

  7. iffiliate
    Member
    Posted 3 years ago #

    Are you still running WordPress MU?

    Yes, I do. I am running WordPress 3.1.3 in networking-mode with domain mapping plugin. I deactivated all plugins. After deactivating domain mapping plugin, it works fine.

    I am using subdomain "mode" for domain mapping.

  8. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 3 years ago #

    Yes, I do. I am running WordPress 3.1.3 in networking-mode with domain mapping plugin. I deactivated all plugins. After deactivating domain mapping plugin, it works fine.

    The last version of WordPress MU was 2.9.2. The reason I was checking is that there was a version of MU that the previews did not work (I don't remember which one). Also, if you say you're running MU many people will assume that you are running version 2.9.2 or older.

    What do you have for DM settings? Did you edit the URL of the site in the edit site screen?

  9. multimule
    Member
    Posted 2 years ago #

    I wonder if preview works for anybody with a mapped domain?

    I've recently opened a ticket explaining how I _think_ the error is caused: https://core.trac.wordpress.org/ticket/18069
    (Also note this one: https://core.trac.wordpress.org/ticket/16776)

    Can anyone tell if that is actually the cause?

    Ron, when you checked, did you make sure you weren't logged in to the mapped domain as well?

    I ask, because if I log in to exampleblognetwork.com AND to mappeddomain.com then the preview works and admin bar is available too.

  10. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Ron, when you checked, did you make sure you weren't logged in to the mapped domain as well?

    Post preview only works if you are logged in. That applies to single sites, networks & domain mapped sites.

  11. multimule
    Member
    Posted 2 years ago #

    Sure.

    What I mean is this:

    When I log in only to exampleblognetwork.com only then the preview fails.

    If, however, I log in to mappeddomain.com _in addition_ then I may
    1. go to blog.examplenetwork.com's backend,
    2. hit "preview" there
    3. be redirected to http://mappeddomain.com/?p=123&preview=true
    4. see the preview, as it's now possible due to the fact that I am logged in to mappeddomain.com too.

    However, if I _log out_ from mappedomain.com I still have access to the dashboard of blog.examplenetzwork.com. Hitting "preview" then will present me with a 404 on mappeddomain.com.

    Can you confirm this?

  12. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    However, if I _log out_ from mappedomain.com I still have access to the dashboard of blog.examplenetzwork.com. Hitting "preview" then will present me with a 404 on mappeddomain.com.

    I can confirm that if you are not logged into mappeddomain.com, the post preview of http://mappeddomain.com/?p=123&preview=true will not work.

  13. multimule
    Member
    Posted 2 years ago #

    Sounds like that error is by design then (?)

    Do you happen to know of any workaround which allows users to only log in _once_ (to the network) and then easily switch between the blogs (just like they can if the blogs are on subdomains only) ?

    Cheers

  14. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Sounds like that error is by design then (?)

    Yes, security.

    Do you happen to know of any workaround which allows users to only log in _once_ (to the network) and then easily switch between the blogs (just like they can if the blogs are on subdomains only) ?

    Browser security prohibits web servers from accessing cookies from other domains. If you want them to be logged into both then you need to enable the remote login feature.

  15. multimule
    Member
    Posted 2 years ago #

    Ofc I have remote login activated (as I was already guessing this was meant for that).

    Is there anything else that has to be set in order to make this work? I've just tried XML-RPC for example ...

    My setting at "Domain Mapping" in the Network Admin are: 1, 3 & 4.

  16. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    So, if you have remote login enabled, why are they logged out on the mapped domain?

  17. multimule
    Member
    Posted 2 years ago #

    Well that's the question I am asking. But don't bother to answer - for explaining the problem thoroughly I am getting nothing but snippy comments here.

  18. I'm sorry you feel Ron's comments are snippy - often text on the screen does not communicate tone.

    It's a valid question. Why are users logged out of the mapped domain?

  19. If, however, I log in to mappeddomain.com _in addition_ then I may
    1. go to blog.examplenetwork.com's backend,
    2. hit "preview" there
    3. be redirected to http://mappeddomain.com/?p=123&preview=true
    4. see the preview, as it's now possible due to the fact that I am logged in to mappeddomain.com too.

    Bolded because that caught my eye.

    I'm not the best at this plugin, but I was under the impression that when you turned on remote admin, you no longer go to mappeddomain.example.com/wp-admin for the backend of your site, but mappeddomain.com/wp-admin

    All that said.

    If you turned on Remote Login at any point in the middle of all this, log off. DELETE your cookies, log back on. See if that helps. Browsers (like Chrome) are often idiots when it comes to this.

  20. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Well that's the question I am asking. But don't bother to answer - for explaining the problem thoroughly I am getting nothing but snippy comments here.

    Sorry, that wasn't the intent. You said above that if the user logs out of the mapped domain you see the issue. So, I was legitimately asking why are the users logging out of the mapped domain.

    Secondly, I've explained that unless the user is logged into the mapped domain the preview will not work on a preview link for said mapped domain. That's not something that can be fixed in the DM plugin.

    The user needs to be logged in for security reasons. I doubt most WP site owners want WP to show post previews to anyone who has the URL for it.

  21. ceeb
    Member
    Posted 2 years ago #

    I can confirm I was experiencing the same issue.

    To summarize:

    Steps to reproduce:

    1. The URL http://mysite.com/wp-admin automatically redirects to http://mysite.network.com/wp-admin where you can login.
    2. Edit a new page or post and hit Preview. The preview URL is: http://mysite.network.com/?page_id=123&preview=true
    3. The DM plugin automatically redirects to http://mysite.com/?page_id=123&preview=true. This fails with a 404 - probably because the login cookie doesn't exist on that domain (the preview works if the primary mapping domain is set to http://mysite.network.com/).

    However, if you untick "Redirect administration pages to site's original domain" in the network settings, no redirects will occur and previews will work.

  22. multimule
    Member
    Posted 2 years ago #

    Thanks, ceeb - you explained the issue much better than I was able to :)

    @ceeb: Unticking the "Redirect administration pages ..." works because then a user is logged in (only) to the mapped domain (-> BUT no quick switching between blogs in the network possible)

    @Ron: Allright. Of course, nobody but logged in users shall be able to preview. What I mean is that users who are logged in to http://mysite.network.com/ are unable to view http://mysite.com/?page_id=123&preview=true (as described by @ceeb) and will not see the admin bar.

    Secondly, I've explained that unless the user is logged into the mapped domain the preview will not work on a preview link for said mapped domain.

    If that is definitely impossible - what is the "Remote Login" checkbox meant for / doing?

    @Ipstenu: The variant you describe needs unticking "Redirect administration pages ..." (see above) which works, but is unintended in the current case.

    @Andrea_r: You are right. Thanks for clarifying!

  23. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    what is the "Remote Login" checkbox meant for / doing?

    Having that checked would mean the preview would work as long as the user doesn't log out of the mapped domain.

  24. multimule
    Member
    Posted 2 years ago #

    Having that checked would mean the preview would work as long as the user doesn't log out of the mapped domain.

    Did you try that?

    I am asking, because the checkbox "Redirect administration pages ..." has to be ticked in order to be able to tick "Remote Login" as well.

    But how can one log in to the mapped domain if administration pages (incl. login page) are on the original (network) domain?

  25. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Did you try that?

    Yes.

    If that's checked (and the redirect admin pages is checked) at the time the user logs in the DM plugin works a little magic to log the user into the mapped domain at the same time they are logging into the admin area.

  26. multimule
    Member
    Posted 2 years ago #

    Cool. It seems we tracked down the bug description at least b/c that's exactly what's failing here :)

    ceeb, can you confirm that this is also what you had experienced?

    Ron, is there any additional setting - in Apache maybe (?) - necessary in order to make that work?

  27. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Ron, is there any additional setting - in Apache maybe (?) - necessary in order to make that work?

    To reiterate, you need to either

    - have both the redirect admin pages & remote login checked or
    - have both the redirect admin pages & have the user log into the remote domain manually

    There isn't a server setting you can change. Unless the user is logged into the remote domain, WP will not generate a post preview.

  28. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Your user may have security software which is preventing the remote login script from working. If you could track down a browser error that would be helpful.

  29. multimule
    Member
    Posted 2 years ago #

    I tried FF5's "safe mode" (all plugins disabled) on Ubuntu and IE7 on WinXP - both failed.

  30. besson3c
    Member
    Posted 2 years ago #

    Hello,

    I'm being affected by this problem too, but if you don't mind I wouldn't mind clarification on the following overall summary of where things stand:

    The problem is that the WordPress Network doesn't see users as being logged into their mapped domain when they are logged into the primary top level administrative domain, even with the Domain Mapping Remote Login checkbox checked (as mine is).

    If this is indeed accurate, is there not much that can be done ever? Is it even possible to set a cookie on the mapped domain when this domain is not being accessed at login time? Or, is this a known issue being worked on?

    If I'm understanding things correctly and there is a way to set cookies for arbitrary domains, I might poke around the plugin code to see if I can come up with a fix, but I figured it would be best to first check in with you guys to make sure I have a handle on the overall situation.

    Thanks in advance for your attention!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic