WordPress.org

Ready to get started?Download WordPress

Forums

WordPress won't work on add-on domain with .htaccess 301 redirects (7 posts)

  1. lollacorn
    Member
    Posted 3 years ago #

    Hi,

    I have registered a domain and an add-on domain within my hosting package.

    I am trying to install wordpress on the addon domain. However, I need to edit the .htaccess file so that all possible versions of the add-on redirect to "www.addondomain.net", as there are many different variations that could cause trouble with search engine duplicate content (and I don't want to the addon domain to be associated with the original domain), etc (addondomain.originaldomain.net, originaldomain.net/addondomain, as well as just addondomain.net without the www).

    However, now that I've installed wordpress, I'm receiving the following error when trying to access it on http://www.addondomain.net:

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    I've tried different variations within the .htaccess to contain both my 301 redirects as well as the essential .htaccess of wordpress, but I can't get ANYTHING to work!

    Please can someone help me fix this issue?

    Thanks very much in advance. :)

  2. Usually, the redirect from non-www to www causes this. WordPress will take care of this particular redirect on its own, so there's no need to repeat it in the .htaccess file. I recommend removing it.

  3. lollacorn
    Member
    Posted 3 years ago #

    Hi,
    Thanks for your reply.

    I tried removing that particular redirect but I'm still receiving the same error.

  4. lollacorn
    Member
    Posted 3 years ago #

    Thinking about your advice, I checked in the wordpress cpanel and saw that the domain was configured to addondomain.com and not http://www.addondomain.com.

    I changed this and it seems to be working well now. Thanks very much! (I didn't even need to remove the non-www to www redirect).

    Could anyone please confirm that the following .htaccess won't cause any problems with wordpress AND will redirect all the possible add-on domain variations correctly to http://www.addondomain.com to avoid duplicate content issues:

    #FORCE www
    <IfModule mod_rewrite.c>
    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^(www\.)?addondomain\.mydomain\.com [NC,OR]
    RewriteCond %{HTTP_HOST} ^!www\.addondomain\.com [NC]
    RewriteRule ^(.*)$ http://www.addondomain.com/$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^addondomain.com [NC]
    RewriteRule ^(.*)$ http://www.addondomain.com/$1 [R=301,L]
    RewriteCond %{REQUEST_URI} ^/addondomain($|/.*$)
    RewriteRule ^.* http://www.addondomain.com%1 [R=301,L]
    </IfModule>

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress

  5. I'd still remove the bit under #FORCE www since WordPress does this automatically.

  6. lollacorn
    Member
    Posted 3 years ago #

    Which bit exactly?

  7. Come to think of it, I'd remove the whole thing up to # BEGIN WordPress. Forcing www is redundant as WordPress will do that for you, and the rules involving http://www.addondomain.com/$1 will just redirect all of your internal links back to your main domain.

Topic Closed

This topic has been closed to new replies.

About this Topic