WordPress.org

Ready to get started?Download WordPress

Forums

WordPress MU Domain Mapping
Non www mapped domians erroring out. (10 posts)

  1. escalatoraccidnt
    Member
    Posted 3 years ago #

    Hey everyone. Great post, tutorial, and plugin. Just want to say thanks all around.

    One thing that seems to come up a few times in this discussion, but never really explained by the ninjas, is getting a subdomain that it mapped to work if someone types subdomain.com into their address bar.

    Just so I can let you know all my steps:

    A. I have my main domain as the main account on a shared host (hostgator with cpanel)
    B. I created a subdomain and called it * and the root domain = maindomain.com and the document root is /public_html
    C. In my wp-config.php I have this rule define( 'DOMAIN_CURRENT_SITE', 'maindomain.com' );
    D. In my domain mapping options, I have it set to to server CNAME domain instead of the IP address (the ip doesn't go to my main site if I type it in my address bar) and I've entered maindomain.com
    E. I've successfully parked 10 subdomains and added 10 subdomain.maindomain.com sites.
    F. I've successfully mapped each subdomain to work at http://www.subdomain.com.
    G. Here is where my trouble starts. If I navigate to subdomain.com or maindomain.com without the www I get an error "The page isn't redirecting properly Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies." - This seems like a big error to me. How can I force an attempt to navigate to a non www site go to the correct http://www.site.com address?

    Any help would be greatly appreciated.

  2. From http://wpmututorials.com/plugins/donnchas-domain-mapping-plugin/#comment-8670

    My DM plugin does not support www domains.

    So I'm not sure how you got here in the first place. I think you'll have to .htaccess redirect non www to the www version.

  3. escalatoraccidnt
    Member
    Posted 3 years ago #

    Wow,

    I got everything working with the www, just not without. ha ha. Backwards I guess. MU thinks there's no blogs at the non www address.

    So you think an .htaccess rule can point any non www requests to the www domains?

    I'm familiar with .htaccess, but not enough to think of how to write that rule myself.

    My goal was hopefully to have these sites function as independent websites, but save myself by running it all from one install.

    I really appreciate the help, thanks.

  4. @ipstenu - old comment, I think it does now.

  5. @Andrea_r - June 11, 2010 isn't that long ago, though, so I thought it might be applicable still.

  6. Yeah, I know. :-/ At least I think he fixed it.. and when Ron mention his plugin, he means the paid one - not the one in this thread, even tho he's an author on it too. (confusing? yes)

  7. I don't know... I don't use the plugin anymore (set it up once for someone, they've never had a problem, info fell out of my brain).

    Anyway, the .htaccess redirect for www/non-www:

    # www redirect
    RewriteCond %{HTTP_HOST} ^subdomain.com
    RewriteRule ^(.*)$ http://www.subdomain.com/$1 [R=301,L]

    Put it ABOVE your WordPress rules on domain.com. Should work.

  8. escalatoraccidnt
    Member
    Posted 3 years ago #

    Thanks for the help @ipstenu,

    1 question for clarification, would I just repeat that 10 times, including the rule for each domain name?

    @Andrea_r, I didn't know there is a premium option. What's the difference with each plugin and where would I find it. Would it allow me to run these sites as independent sites easier than what I'm doing now?

    Thoughts?

    Thanks for the help everyone.

  9. escalatoraccidnt
    Member
    Posted 3 years ago #

    I just wnated to comment in here to help anyone searching on this issue.

    @ipstenu That .htaccess rule worked great! All the sites work the original way by navigating to the http://www.site.com and if you navigate to any site with the non-www and just site.com it instantly jumps the the www address.

    I just want to say thank you for the help.

    Not sure if I should start a new thread on this, but in the <head> of every subdomain site, it has a javascript tag that has the entire main site code in there. That can't be good for SEO. Is there a way to remove/hide that.

    <script type="text/javascript" src="http://www.maindomain.com/?dm=24552c4d67abf488432892b814429ac4&action=load&blogid=3&siteid=1&t=143784708&back=http%3A%2F%2Fwww.subdomain.com%2F"></script>

  10. webseeker
    Member
    Posted 3 years ago #

    Hi there, I too have mapped domains and trying to keep the www on each domain by making a change to the htaccess file.

    I have tried adding each domain www redirect to the htaccess as suggested above but when I visit the site it says there is a redirect loop.

    Can someone please help.

    RewriteEngine On
    # www redirect
    RewriteCond %{HTTP_HOST} ^domain1.com
    RewriteRule ^(.*)$ http://www.domain1.com/$1 [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^domain2.com
    RewriteRule ^(.*)$ http://www.domain2.com/$1 [R=301,L]
    
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule . index.php [L]

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic