• Hi All,

    I have a WPMU installation working with two unique websites with domains maindomain.com and otherdomain.com

    I have parked domains at maindomain.ie and otherdomain.ie which I want to permanently redirect to the appropriate .com domains above. I want this redirection to also redirect maindomain.ie/about to maindomain.com/about not just to drop the /about and redirect to maindomain.com.

    This works for otherdomain.ie/about redirecting to otherdomain.com/about but not for main domain. Please see my .htaccess file below:

    Options +FollowSymLinks
    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^maindomain.ie$ [OR]
    RewriteCond %{HTTP_HOST} ^www.maindomain.ie$
    RewriteRule (.*) https://www.maindomain.com/$1 [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^otherdomain.ie$ [OR]
    RewriteCond %{HTTP_HOST} ^www.otherdomain.ie$
    RewriteRule (.*) https://www.otherdomain.com/$1 [R=301,L]
    
    # BEGIN AnyFont
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^images/(.*)\.png$ /wp-content/plugins/anyfont/img.php [L]
    </IfModule>
    # END AnyFont
    
    # BEGIN WordPress
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule  ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    # END WordPress

    A second lesser question: why does the above .htaccess (or WPMU in general?) drop the www. after redirection. i.e. – even if I go to https://www.maindomain.com it goes to maindomain.com (this happens for both maindomain and otherdomain)

    Any help is greatly appreciated. Thank you very much in advance.

    Best Regards,
    ~mccrodp

  • The topic ‘Parked domains with .htaccess redirection issues’ is closed to new replies.