www. for custom domains and redirect non-www

I user networks for a multi custom domain installation.
So I need every custom domain starting with www. and to redirect an non-www call.
When I set up domain mapping with http://www.custom.com ist is cut off (custom.com).
I need ist the other way around custom.com redirects (301) to http://www.custom.com.

A second question is, how i can setup the primary network domain with http://www.network.com although the network ist setup with network.com.
Can I add the www-call after the network setup manually, making sure that network.com is redirected to http://www.network.com?

  • aecnu

    Greetings brainfruit,

    When I set up domain mapping with http://www.custom.com ist is cut off (custom.com).

    This is the way it must be. WWW is considered a sub domain and setting up a network with sub sub domains does not work at all.

    http://www.networkdomain.com ->Bad
    networkdomain.com -> Good
    http://www.sub.networkdomain.com --> bad
    apples.networkdomain.com --> Good

    And this is why when setting up a domain in Domain Mapping you experience the www being cut out of the domain.

    A second question is, how i can setup the primary network domain with http://www.network.com although the network ist setup with network.com.
    Can I add the www-call after the network setup manually, making sure that network.com is redirected to http://www.network.com?

    No you cannot do this or the network will not function.

    First of all the network setup without the www is on purpose, because it will not work this way. WWW is a sub domain.

    If you look at DNS settings of your hosting account the domain is networkdomain.com and it will have a CName record of www which when the domain name http://www.networkdomain.com is put into the browser URL it will be sent to your network and automatically translated to networkdomain.com

    Thank you for being a WPMU Dev member!

    Cheers, Joe

  • brainfruit

    Hi Joe,

    thanks for your very quickt answer!

    What is bad with http://www.custom.com?
    When I use Domain Mapping a customer should be able to choose between http://www., blog., xyz. or custom.com (he should also be able to use http://www.blog.custom.com).
    And www. should be the default for a new site/blog - how many sites do you visit day by day without http://www.?

    And what does not work with sub.sub.domains.com?
    http://test.wpmudev.brainfruit.cc/
    (I know some big companies putting a www. in front of every single subdomain like http://www.intranet.company.com - although I really don't get this)

    And I don't get your DNS explanation.
    I hardly know any hosting account where the www. host is added as a cname - as I hardly know major domains with the www. cut of (except wordpress.com or twitter.com).

    Marcus

  • aecnu

    Greetings brainfruit,

    Servers are my profession and I am Global Network Administrator for two corporations on either side of the Atlantic - US and Europe.

    Now I guess as they say the proof is in the pudding. Below are DNS screen shots from servers US coast to coast - you can trace route their domains if you do not believe me and they all are exactly what I label them as.

    Every single one uses the Domain Name proper and the www is a cname.

    Proof 1 DNS screenshot below from Columbus Server

    Proof 2 DNS screenshot below from GoDaddy Server

    Proof 3 DNS screenshot below from HostGator Server

    Proof 4 DNS screenshot below from Seattle Server

    Now that I have shown you that every single one has the www and it is a cname - please show me just one where it is not?

    Please advise.

    Cheers, Joe

  • brainfruit

    Dear Joe,

    we divagate a bit into DNS talk (I will answer this at the end).

    The main questions are:

    Why is http://www.custom.com "bad"?
    This is the most common way for a website setup - I want to use it like in your teaser graphic for Domain mapping (attached).

    Why should a sub.sub.domain.com not work at all?
    There are some projects we definitely use this scenario.

    Concerning the DNS topic we have to differentiate between CName, redirect and host header.
    A CName points a host to the IP address of another host. But this does no redirection at all - especially in virtual server setups the webserver listens to the host header.
    Like in your example: http://www.grandfatherdragon.com isn't redirected to grandfatherdragon.com.
    Convenience wise I agree with you that setting up a www. as a CName to the root is OK.
    But it't not the "one and only" correct way to do this (http://forums.theplanet.com/lofiversion/index.php/t69879.html)
    I also attached the default DNS settings of our hoster, one of the top 3 in Germany.

  • aecnu

    Greetings brainfruit,

    I see that you have a complete grasp of the DNS and WordPress MultiSite integration and therefore I do not understand the need for this ticket?

    To debate how DNS works, I do not think so.

    I sincerely want to help people that want help, not call in for help and then tell me what is wrong, because if they knew what was wrong in the first place or they were doing it right they would not be asking for help and would obviously have no issues.

    I will bring up one last fact before I get out of this ticket, we are talking DNS and sub domains of sub domains etc. But the bottom line is that with MultiSite installs, DNS is being handled by WordPress itself and not by DNS to the point of where DNS hands the function over to WordPress upon reaching the IP, and knowing this I therefore stand by my original claim that sub domains of sub domains will not work, that the www is not going to work, though I agree that it will work on the outside of WordPress but not within WordPress MultiSite.

    Go ahead and feel free to try it your way as you see fit, you should have no trouble getting it to work regardless of what I think or have to say about the issues and challenges faced when integrating with WordPress MultiSite.

    Cheers, Joe

  • brainfruit

    Dear Joe,

    thanks for your answer - maybe it's hard for me to explain my problem, because I'm not a native English speaker.

    I want to use the Domain Mapping tool to setup custom domains as shown in your description (attached) of the plug in: http://www.yourdomain.com

    How can I setup "www.yourdomain.com" with the Domain Mapping plug in for a customers custom site?
    (I'm not talking about the network domain or the Multi-Domains plug in)

    Since websites mostly start with www. and your plug in is designed to allow custom domains for customers websites in a WordPress network installation, supporting www. is a must have.

    Sincerely, Marcus

  • aecnu

    Greetings Marcus,

    Just set up the Domain Mapping using the regular domain name domainname.com with the domain name pointing at the IP with an "A" record without the www and when a person types in http://www.domainname.com it will resolve correctly.

    No additional entries required, just the "A" record domainname.com pointing to the WordPress MultiSite install IP. WordPress will do the rest :slight_smile:

    Check that the mapped domain is working http://domaname.com and then please try http://www.domainname.com, I think you will be pleasantly surprised that indeed it works.

    But do not be surprised that WordPress will then turn around and change the url to domainname.com

    I offer you this explanation and information from direct experience and two working network that operate successfully in this very manner.

    Please advise.

    Cheers, Joe

  • aecnu

    Greetings Marcus,

    I sincerely do not think it can be done without modifying the core code of WordPress and the way it handles MultiSite domains.

    However, I will see if I can get the lead developer of the Domain Mapping plugin in here to offer us advice/advise us of the possibilities.

    This may take a bit more time then a normal ticket, but lets see if we can possibly get this sorted out for you.

    Cheers, Joe

  • Barry

    Can this be done with a hack?
    This should be definitely on the to-do list for this extension!

    It is wordpress multisite itself that strips out the www from the domain name, not the domain mapping plugin - so attempting to have domain.com redirecting to http://www.domain.com will then result in WP stripping out the www. and redirecting back to domain.com - which as you will no doubt see will result in an infinite redirect.

  • aecnu

    Greetings Marcus,

    As I had suspected this is a core WordPress MultiSite function and not related to the Domain Mapping plugin, but it was a good idea to get confirmation of this fact as the lead developer has now given.

    Therefore this ticket will be marked as resolved since we have come to the end of this topic and I am sorry to report no alternative due to the core functions of WordPress MultiSite itself.

    If you need further assistance with anything else please fell free to submit a new ticket for that subject and we will be happy to assist you in anyway that we can.

    Cheers, Joe

  • brainfruit

    Dear Bary, dear Joe,

    don't get me wrong I appreciate your good work and your astonishingly creative plug ins.

    Domain Mapping was my major reason to become an elite member of WPMU DEV and I was happy to get "everything I need" from one source.

    Now I'm quite disappointed that I had to use a free plug to do my job:
    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

    The results (perfectly redirected SEO wise):
    http://test.wpmudev.brainfruit.cc
    http://test.e-sy.biz
    http://e-sy.biz
    redirects to
    http://www.e-sy.biz

    I don't mind if your extension does not have this function at this point of time.
    But we wasted our time with none existing DNS problems, elaborating why www. could be bad or that something can't be done 'cause of WordPress.

  • aecnu

    Greetings brainfruit,

    I cannot speak for Barry, but I still think you will in the long run find out we were right when it all starts crashing down around you --> in which I do not wish on anybody.

    My orders from headquarters are to resolve any ticket I can regardless of where the plugin or solution comes from - I have no problem referring folks to plugin or other solutions outside of WPMU Dev and though I knew of this plugin.

    I still do not think it is the long term solution for this task knowing of its inherent problems with WordPress resolving the DNS calls, and I still think you will see problems once some stress is put to it, but I sincerely hope this does not happen.

    Happy to hear that you have gotten things sorted out one way or the other.

    Cheers, Joe

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.