• 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 https://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. ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator James Huff

    (@macmanx)

    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.

    Thread Starter lollacorn

    (@lollacorn)

    Hi,
    Thanks for your reply.

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

    Thread Starter lollacorn

    (@lollacorn)

    Thinking about your advice, I checked in the wordpress cpanel and saw that the domain was configured to addondomain.com and not https://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 https://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 ^(.*)$ https://www.addondomain.com/$1 [R=301,L]
    RewriteCond %{HTTP_HOST} ^addondomain.com [NC]
    RewriteRule ^(.*)$ https://www.addondomain.com/$1 [R=301,L]
    RewriteCond %{REQUEST_URI} ^/addondomain($|/.*$)
    RewriteRule ^.* https://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

    Moderator James Huff

    (@macmanx)

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

    Thread Starter lollacorn

    (@lollacorn)

    Which bit exactly?

    Moderator James Huff

    (@macmanx)

    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 https://www.addondomain.com/$1 will just redirect all of your internal links back to your main domain.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WordPress won't work on add-on domain with .htaccess 301 redirects’ is closed to new replies.