WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
www and no-www redirection (11 posts)

  1. hgurol
    Member
    Posted 2 years ago #

    Hi,

    This is a new 3.4 install on a subdomain.
    main site is: wp.example.com

    After enabling the network sites and domain mapping module, I have mapped http://www.example.org to one of my subfolder setup sites. And it works normally.

    But when I visit example.org without the www, it redirects to the main site wp.example.com.

    How can I make example.org to redirect to http://www.example.org.

    http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/

  2. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    IF you want Domain Mapping to respond to both the www and non-www map the non-www version of the URL.

  3. hgurol
    Member
    Posted 2 years ago #

    No, I dont want it to respond to both versions. I just want it to work with the www prefix and I want it to redirect non www requests to the www version of the domain name. Right now, it redirects to the main site which is really unpleasant.

  4. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    I just want it to work with the www prefix and I want it to redirect non www requests to the www version of the domain name.

    That would be responding to both versions. Domain mapping is designed to redirect the www to the non-www when you have the non-www mapped.

    For what you are trying to do map the www and add a rewrite rule to your .htaccess to redirect the non-www to the www.

  5. hgurol
    Member
    Posted 2 years ago #

    My only mapping for network site is with www.
    and if I type in the url without www, it redirect to the main site, not to the network site and that is a problem.

    Making the network site work both with www and with no-www is another problem, not as big a problem as the one above but it is still a no-no.

    This is a fresh 3.4 install all followed by the official instructions, nothing custom.

    Im no good with writing rewrite rules, is there a place that I can look at some samples and go from there?

  6. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

  7. BackuPs
    Member
    Posted 2 years ago #

    Can't this be done in the A record (in your dns settings) I didn't have to alter any htaccess or add any rewrite rule to get this to work.

  8. hgurol
    Member
    Posted 2 years ago #

    Im not sure about fixing it with a DNS entry. Both the http://www.example.com and example.com already resolves to the same IP address.

    I have my main setup running at...
    http://wp.mymainsite.com
    its a subdomain, not a tld, so this might a problem, i dont know.

    Then I have a domain mapping like this...
    http://wp.mymainsite.com/site1 --> http://www.example.com
    which works fine.

    However, when I type the domain without www leading, like...
    http://example.com I would expect two things, which neither happens.
    1- it redirect to the http://www.example.com or
    2- it serves the site as it has been typed like http://example.com

    I do not expect it to redirect the request to the main site, which happens unexpectedly...
    http://example.com --> http://wp.mainsite.com

    Now, I can add another domain mapping entry for the non-www version of my additional website
    http://wp.mymainsite.com/site1 --> http://example.com
    This will prevent non-www entries to my additional site to redirect to the main site.

    Now the new problem is I have two different versions of my website running with and without the www leading. Which it should not.

    A rewrite rule which redirects all non-www requests to the http://www.example.com in .htaccess will solve the problem. Which, I have not been able to write that entry yet.

    This MAY or MAY NOT be a problem or bug with the plug-in. I really do not know. This might be the way it works by design. If it is the way it works, maybe this issue should be documented.

    @BackuPs, please tell me about your setup. How is your setup works out of the box?

  9. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    This MAY or MAY NOT be a problem or bug with the plug-in. I really do not know. This might be the way it works by design. If it is the way it works, maybe this issue should be documented.

    I explained above that it is by design. The correct way todo the redirect is with a rewrite rule.

  10. Ron Rennick
    MultiSite Guru
    Plugin Author

    Posted 2 years ago #

    Further to my previous post - If you set up your WordPress network at http://www.domain.com, WP does not redirect domain.com to http://www.domain.com. You have to do that redirect with a rewrite rule as well. Domain mapping is designed to be consistent with WordPress.

  11. Nadiamode
    Member
    Posted 1 year ago #

    hgurol' issue same to me

    example:

    wordpress mu = http://www.mucenter.com
    new domain = http://www.newbox.com

    step:

    1. point/park domain http://www.newbox.com in cpanel/directadmin
    2. mapping domain "www.newbox.com" in http://www.mucenter.com's admin page

    result:

    1. http://www.newbox.com go http://www.newbox.com = correct
    2. newbox.com go http://www.mucenter.com = false

    resolve:

    1. mapping domain "newbox.com" in http://www.mucenter.com's admin page too

    so now you have

    1. "newbox.com" in http://www.mucenter.com's admin page
    2. "www.newbox.com" in http://www.mucenter.com's admin page

    after that:

    1. http://www.newbox.com go http://www.newbox.com = correct
    2. newbox.com go http://www.newbox.com = correct

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.