• Resolved Anonymous User 14978628

    (@anonymized-14978628)


    Hi, when i test with GT Metrix it gives me warnings to remove redirect chains from my domain to the cdn domain. This occurs when i enable css/js minify. It also gives me redirect warnings for the async.js and lazyload.js. Is this normal and i didn’t see such redirects using Autoptimize?

    Edit: just noticed Gt Metrix is saying the CDN url is redirecting to the domain url. Shouldn’t it be the other way around?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Support Cold Egg

    (@eric780217)

    Hi martychc23,

    My site running with CloudFlare and set minify css/js enabled but not successful to reproduce it on GT Metrix. Could you provide Report number and site link to us for check?

    P.S. you can get report number from LSCache -> report.

    Best,
    Eric

    Thread Starter Anonymous User 14978628

    (@anonymized-14978628)

    Hi Eric,

    My report number is: CEDRYSJP

    Here is the issue i’m seeing on GTMetrix: https://gtmetrix.com/reports/www.celebrityhealthcritic.com/r5KkinFT

    Look at the redirects section on pagespeed and yslow tabs in GTMetrix.

    Thanks

    Plugin Support Cold Egg

    (@eric780217)

    Hi martychc23,

    I just checked your site, there is no
    https://www.celebrityhealthcritic.com/min/018d7.js
    https://www.celebrityhealthcritic.com/min/018d7.js/
    and other “Remove the following redirect chain” thing in your site by browser dev tool.

    1. Please try purge all and purge from CDN, see if it works to you.
    2. Stop CDN and try GTMetrix again, find which part is the issue come from.

    Best,
    Eric

    • This reply was modified 7 years, 3 months ago by Cold Egg.
    Thread Starter Anonymous User 14978628

    (@anonymized-14978628)

    Hi, I’ve gone back to using CDN enabler and Autoptimize so these errors don’t appear anymore.

    Plugin Support Hai Zheng?

    (@hailite)

    Hi @martychc23,

    In your .htaccess, you have the following 301 redirection which caused the GTMetrix warning

    # Trailing slash
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ https://www.celebrityhealthcritic.com/$1/ [L,R=301]

    Our JS optimization doesn’t generate real files to get more efficient. The above rules redirected it.

    You may need to remove that line to get GTMetrix giving a higher score.

    Thanks

    Hai

    Thread Starter Anonymous User 14978628

    (@anonymized-14978628)

    Ah, ok then. That htaccess code is meant to ensure there is a trailing slash at the end of urls to avoid duplicate content issues.

    So if i removed this code would i not then have duplicate content issues for urls with and without trailing slash?

    Plugin Support Hai Zheng?

    (@hailite)

    If you would like to keep it, that’s fine, just need to add one more RewriteCond to exclude ‘/min/’ path before RewriteRule.

    Thread Starter Anonymous User 14978628

    (@anonymized-14978628)

    Could you please provide the line i would need to include in my htaccess for this exclusion?

    Plugin Support Hai Zheng?

    (@hailite)

    try changing

    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteRule ^(.*)$ https://www.celebrityhealthcritic.com/$1/ [L,R=301]

    to

    
    RewriteCond %{REQUEST_URI} !(.*)/$
    RewriteCond %{REQUEST_URI} !^/min/.*
    RewriteRule ^(.*)$ https://www.celebrityhealthcritic.com/$1/ [L,R=301]
    
    Thread Starter Anonymous User 14978628

    (@anonymized-14978628)

    That’s great, thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Redirect Chain’ is closed to new replies.