• Hello everybody!

    I’ve been working on getting my first real WordPress Network set up on my own (owned) “Dynamic-DNS-Enabled” server. I’ve gotten ALMOST everything working after a few days. I’ve got one snag holding me back from considering the site ready for production… The domain mapped site keeps redirecting back to my main site (which has a 301 redirect for itself to ssl) if using the bare url.

    For instance:

    example.com <– default_server
    elpmaxe.moc <– domain mapped site

    If I enter example.com I get redirected to https://example.com – fine.
    https://example.com – fine.
    https://elpmaxe.moc – fine!
    elpmaxe.moc –> https://example.com – not ok.

    Here’s the details:

    Ubuntu Server 16.04
    Wordpress 4.6.1
    nginx 1.10.0

    Plugins:
    Divi Builder
    Mailgun
    Nginx Helper
    W3 Total Cache
    WordPress MU Domain Mapping

    I installed WordPress using easyengine’s Subdomain/Domain Mapping/fastcgi install scripts. Guides here and here.

    Pastebin of nginx config for you below. If you need more info I am more than happy to provide/troubleshoot/find out.
    /etc/nginx/sites-available/example.com – literal
    http://pastebin.com/rdRhpVV0

    I am using namecheap.com as my registrar/DNS provider.

    Advanced DNS settings for both sites:

    _______________________________________________________________________

    example.com

    Type________________Host________________Value________________TTL
    A+DynDNS Record_____@___________________MY_IP_ADDRESS________Auto
    CNAME_______________*___________________example.com._________30 min
    CNAME_______________(sub.for.mailgun)___(mailgun.org)________Auto
    CNAME_______________elpmaxe_____________example.com._________Auto
    CNAME_______________www_________________example.com__________30 min
    TXT_________________(sub.for.mailgun)___(mailgun.org)________Auto
    TXT_________________(mx.for.mailgun)____(mailgun.org)________Auto

    _______________________________________________________________________

    elpmaxe.moc

    Type________________Host________________Value________________TTL
    A+DynDNS Record_____@___________________MY_IP_ADDRESS________Auto
    CNAME_______________elpmaxe_____________example.com._________Auto
    CNAME_______________www_________________elpmaxe.moc__________Auto

    _______________________________________________________________________

    For Domain Mapping:

    Network Admin: example.com –> Dashboard > Settings > Domain Mapping
    Server IP Address: BLANK
    Server CNAME domain: example.com
    Domain Options Checked: Remote Login, Permanent redirect, User domain mapping page, Redirect administration pages to site’s original domain.

    For Domains:

    Network Admin: example.com –> Dashboard > Settings > Domains
    Site ID________________Domain________________Primary_____| Edit Option | Delete Option |
    5______________________elpmaxe.moc___________Yes ________| Edit Option | Delete Option |

    NOTE: Site ID is definitely correct. Mousing over elpmaxe.moc while under Dashboard > Sites shows: https://example.com/wp-admin/network/site0info.php?id=5

    _______________________________________________________________________

    For Sites:

    URL________________Mapping
    example.com
    elpmaxe.moc________elpmaxe.moc

    NOTE: I had originally created elpmaxe.moc as elpmaxe.examlpe.com (only option to create a new site, right?) and then changed the Site Address (URL) by editing elpmaxe.moc. I changed that site address AFTER setting up the domain mapping.

    _______________________________________________________________________

    That is everything I can think of to provide. I have flushed my local DNS config, tested in different browsers (Chrome, Opera, and (OH NO) Internet Explorer), tested on different networks (my own, via cell connection on my phone, remoted into work and tested from their network), and the results are consistent.

    If I’ve missed anything just let me know and I’ll figure out how to get it to you. 🙂

    THANK YOU to anyone that cares to help. I apologize if the formatting of this post gets funky. I’ll try to edit it into something pretty after it’s posted.

Viewing 1 replies (of 1 total)
  • I’ve never used nginx, but your sites-available file keeps referring to elpmaxe.moc – is everything after line 49 in it’s own conf file?

    In Apache each site requires its own conf file.

    Also I don’t understand why you have this CNAME in both your DNS records:
    CNAME_______________elpmaxe_____________example.com._________Auto

    And I only use CNAME records for sites with subdomains.

    Maybe I’m still too pleb to get it fully, but just my thoughts…good luck!

    • This reply was modified 7 years, 7 months ago by pstockley.
Viewing 1 replies (of 1 total)
  • The topic ‘Subdomain/Domain mapped site redirecting to main site’ is closed to new replies.