The MU forums have moved to WordPress.org

How to change domainname.net to www.domainname.net (6 posts)

  1. Christophe25
    Member
    Posted 15 years ago #

    Hi,

    By default my mu-wordpress website shows domainname.net, but I would like to change it to http://www.domainname.net

    Does anybody know how to do this using .htaccess

    For now, my .htaccess looks like this:

    RewriteEngine On
    RewriteBase /
    
    #uploaded files
    RewriteRule ^(.*/)?files/$ index.php [L]
    RewriteCond %{REQUEST_URI} !.*wp-content/plugins.*
    RewriteRule ^(.*/)?files/(.*) wp-content/blogs.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteCond %{REQUEST_URI} ^.*/wp-admin$
    RewriteRule ^(.+)$ $1/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    <IfModule mod_security.c>
    <Files async-upload.php>
    SecFilterEngine Off
    SecFilterScanPOST Off
    </Files>
    </IfModule>

    Thanks for any help :)

    Kind regards,
    Christophe

  2. andrea_r
    Moderator
    Posted 15 years ago #

    WPMU strips out the www by default.

    http://wpmututorials.com/hacks/forcing-mu-to-use-www/

  3. Christophe25
    Member
    Posted 15 years ago #

    Hi Andrea,

    Thx for the advice!

    I'll try it and hope it will work.

    Kind regards from Belgium,
    Christophe

  4. VentureMaker
    Member
    Posted 15 years ago #

    I'd stay away from forcing www in domain name.

  5. Christophe25
    Member
    Posted 15 years ago #

    Hi,

    I have chosen to stay away from forcing www in domain name (to avoid farther problems) but now I have another minor problem.

    I also have a /wiki (wikimedia) and /forums (phpbb) installed on the same domainname (different directory's of coure :) Both these url's refers to www and non-www, so I would like both to refer to non-www with a 301.

    http://www.domainname.net/wiki -> domainname.net/wiki

    I have a .htaccess in the root (blogs), another .htaccess in the /wiki directory and yet another .htaccess in the /forums directory.

    Does anyone know which code I have to paste to accomplish this redirect in all directory's? And in which .htaccess I have to do this?

    I have already tried: (didn't work :(

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.palmvrienden\.net$ [NC]
    RewriteRule ^(.*)$ http://palmvrienden.net/$1 [R=301,L,QSA]

    Thanks for any help!!!

    Kind regards,
    Christophe

  6. thelaw
    Member
    Posted 15 years ago #

    I have the same problem with my www-based installation of MU. Hopefully I'll post a solution.

About this Topic

  • Started 15 years ago by Christophe25
  • Latest reply from thelaw