make mapped domain works with www and without

Hi,
how to make mapped domain works with www and without?
i don't want to redirect everyone to www or without www. i want that both will work.

Thanks

  • Ash
    • WordPress Hacker

    Hello @Ruslan

    I hope you are well today and thanks for asking the question.

    Do you have any dedicated IP? If yes, create A record for www and point to that IP and then add the domain with www from the domain mapping panel, same as you do for w/o www.

    Please let us know if that works for you.

    Cheers
    Ash

  • Ruslan
    • The Incredible Code Injector

    HI @Ashok
    yes i have dedicated IP and i point from the beginning with www and without from A record.
    i have also added in the domain mapping plugin with www and without but still only one of them work.
    know if i try to go to my website without www it redirect the website to www

    as you can see here one more problem that i can't make domain mapping to work without using park domain. (in the park domain i have add my domain without www).
    https://premium.wpmudev.org/forums/topic/domain-mapping-without-use-parking-domains#post-765727

    please advise.

    Thanks

  • Michael Bissett
    • Recruit

    Hey @Ruslan, hope you've been having a great weekend so far! :slight_smile:

    What is the subsite in question here? Could you mention it please?

    I see that you've sent in the WordPress network admin details, if you could mention which site you're trying to map here, we'd be more than glad to investigate further here. :slight_smile:

    Please advise,
    Michael

  • Ruslan
    • The Incredible Code Injector

    Hi @Michael Bissett,
    i have made some test and seems that with www and without works in wp-admin
    but i get error:
    Font from origin 'http://www.mywebsite.com' has been blocked from loading by Cross-Origin Resource Sharing policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://mywebsite.com' is therefore not allowed access.

    but on the front end the page redirect to one of them, the first one that i have set in maping plugin.

    also one of the domain not redirect at all with www in front.
    it give me the hosting error and redirect to http://www.mywebsite.com/cgi-sys/defaultwebpage.cgi
    but if try to get to http://www.mywebsite.com/wp-admin it works.

  • Sybre Waaijer
    • The Incredible Code Injector

    Hello @Ruslan

    I believe that Domain Mapping cannot work with WWW.
    This is because domain mapping is based upon subdomains and WWW is a subdomain in itself.

    The workaround on this is to create CNAMES that point to the original domain. This will redirect the http://www.domain.com to domain.com, so users can fill in either and still get the same content.

    You can even stretch this further by redirecting ww and wwww to the main domain, so your visitors can even make typos without a worry! :slight_smile:
    I must say though, Domain Mapping does not take these typos into account but you can be an early adopter :slight_smile: It will redirect to the main domain.

    I'll give you a screenshot that looks like yours with the correct settings below.

    Hope this helps!

    I see you're using an external DNS server so this might take a day or 2 to propagate correctly. Patience :slight_smile:

  • Ash
    • WordPress Hacker

    Hello @Ruslan

    With domain mapping it will work with one domain only (either with www or without), the other one will redirect to first one.

    The domain redirects to default hosting admin page, it means the IP is not pointed correctly. But for better explanation let me include the developer @Sam in this thread for his valuable opinion on this.

    Cheers
    Ash

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.