The MU forums have moved to

Redirect to www sub-domain automatically (5 posts)

  1. zylstra
    Posted 17 years ago #

    How can I redirect all requests for domain.tld to http://www.domain.tld?


  2. ColdCN
    Posted 17 years ago #

    create a cname called "*" point to http://www.domain.tld.

  3. zylstra
    Posted 17 years ago #

    I'm using sub-domains for WPMU (not sub-directories), so if I do that no member blogs will work.

  4. drmike
    Posted 17 years ago #

    You can try reversing Matt's no-www plugin. I don't know if it would work though with the subdomains but you can try it.

    Plugin Name: Gotta have WWW
    Plugin URI:
    Description: For those who want to be old school
    Author: Dr. Mike Wendell
    Version: 1.0
    Author URI:

    if ( strstr( $_SERVER['HTTP_HOST'], 'www.' ) )

    header('HTTP/1.1 301 Moved Permanently');
    header('Location: http(colon)//www' . $_SERVER['REQUEST_URI']);


    Hmm, that would force all of your sites to have the www though which would mess some visitors up.

    Can't really think of any other method myself off teh top of my head.

  5. Xen
    Posted 17 years ago #

    Why do you want www? it's deprecated... the only people who actually use www are stubborn businesses and inexperienced users, I find the opposite to be more useful, a redirect from http://www.domain.ext to http://domain.ext ...

    Each to his own, I'm fairly sure that won't work... you can use www. with subdirectories but not with subdomains to my knowledge... unless you can play with .htaccess to make it work... maybe...

About this Topic