WordPress.org

Forums

[resolved] ww to non-www redirect taking 20-40+ seconds (3 posts)

  1. lonill
    Member
    Posted 1 year ago #

    Hi, hoping someone can help to shed some light on my issue.

    I've got a multi-site set up: my first site is http://www.lonchan.com and on my second site, licensedtoill.lonchan.com the domain is mapped to licensedtoill.co.uk

    When typed into the address bar http://licensedtoill.co.uk loads within a few seconds(generally!) but if someone puts in http://www.licensedtoill.co.uk it takes forever(20-40+ seconds) to realise that it needs to switch to the non-www domain.

    When I look at my site on the ftp, it has the following in the root:
    an old non-wp site folder, a load of "various_other_domain-redirect" folders, and my "lonchan" word press folder, within which is the wordpress install and a subdirectory "licensedtoill.co.uk-redirect" folder.

    I've tried adding the www to non-www codes to the .htaccess file in the lonchan main multisite folder but it redirected all lonchan traffic to my licensedtoill site. so I put a .htaccess file into the licensedtoill-redirect subdirectory but I'm not sure it's actually doing anything.

    Also now looking at my .htaccess files I'm not sure that they are correct as they are totally different. so I'm confused as to how and which one I created and which was with the original wp install as I did this months ago, and with all the tweaking am worried I may have overwritten one or another!

    Any ideas would be greatly appreciated as I a have recently been featured in a publication and so am hopingthat I'll be getting some new traffic to my website which I wouldn't want to lose through long loading times(even though I'd hope they'd come directly through the non-www format).

    Thanks,
    Lon

  2. "licensedtoill.co.uk-redirect"

    I don't even know what that is...

    I've tried adding the www to non-www codes to the .htaccess file in the lonchan main multisite folder but it redirected all lonchan traffic to my licensedtoill site.

    There's a trick to this.

    Read http://halfelf.org/2012/htaccess-anarchy/ and (if you're on apache 2.4) http://halfelf.org/2014/htaccess-revolution/

    On 2.2 it's like this:

    RewriteCond %{HTTP_HOST} ^www\.licensedtoill]\.co\.uk  [NC]
    RewriteRule ^(.*) http://licensedtoill.co.uk/$1 [L,R=301]

    And for 2.4:

    <If "%{HTTP_HOST} == 'www.licensedtoill.co.uk'">
    	RedirectMatch (.*) http://licensedtoill.co.uk$1
    </If>
  3. lonill
    Member
    Posted 12 months ago #

    Hi Mika,

    Thanks for this, I was about to try and fix this, but before I did I tested the site again, and I don't understand why, but today it is loading normally – with a range of 3-7 seconds homepage load on pingdom tools. So for now I figure that it's just a hosting issue more than anything, but I'll keep this for future reference – it's good to have a definitive answer and your articles have a really good explanation as to what's going on.

    Thanks again,
    Lon

Topic Closed

This topic has been closed to new replies.

About this Topic