locked
CDN makes my website has a duplicate URL RRS feed

  • Question

  • Hello, I have a website www.mydomain.com.
    I setup a CDN endpoint (Akamai) with custom domain cdn.mydomain.com and set the host name of the origin as www.mydomain.com.

    The CDN works well but I noticed that if in my browser I enter cdn.mydomain.com, then all my website is shown. Is like having 2 identical websites on www.mydomain.com and cdn.mydomain.com.

    Obviously that's not good for SEO.
    How can I tell the CDN to not cache ASPX pages or to redirect CDN ASPX pages to the canonical domain?


    • Edited by IgorDRTZ Wednesday, November 16, 2016 4:53 PM
    Wednesday, November 16, 2016 4:51 PM

Answers

  • Thanks Richard.
    I found another solution because I noticed that 301 HTTP codes are propagated by the CDN.

    • Basically instead of using www.mydomain.com as the CDN origin, I use the Azure URL, that is mydomain.azurewebsites.net
    • Then in my web.config I permanently redirect every request from mydomain.azurewebsites.net to www.mydomain.com with the exception of images, CSS files, JS files (everything I want to be cached by the CDN)

    In this way users that enter in their browser

    mydomain.azurewebsites.net

    or

    cdn.mydomain.com

    will be redirected to the canonical domain, but the CDN will still be able to cache resources without being redirected.





    • Marked as answer by IgorDRTZ Thursday, November 17, 2016 6:02 PM
    • Edited by IgorDRTZ Thursday, November 17, 2016 6:05 PM
    Thursday, November 17, 2016 5:56 PM

All replies

  • Hi Igor,

    If you wish to not cache ASPX pages, you can either instruct your origin to send Cache-Control: no-cache or no-store headers in the response, or switch to a Azure CDN from Verizon Premium profile, which will allow you to specify custom caching rules directly on the CDN endpoint.

    We are currently working on a feature for Akamai Standard to allow you to specify these types of caching rules, but it is not available from that profile today.

    Wednesday, November 16, 2016 6:48 PM
  • Thanks Richard.
    I found another solution because I noticed that 301 HTTP codes are propagated by the CDN.

    • Basically instead of using www.mydomain.com as the CDN origin, I use the Azure URL, that is mydomain.azurewebsites.net
    • Then in my web.config I permanently redirect every request from mydomain.azurewebsites.net to www.mydomain.com with the exception of images, CSS files, JS files (everything I want to be cached by the CDN)

    In this way users that enter in their browser

    mydomain.azurewebsites.net

    or

    cdn.mydomain.com

    will be redirected to the canonical domain, but the CDN will still be able to cache resources without being redirected.





    • Marked as answer by IgorDRTZ Thursday, November 17, 2016 6:02 PM
    • Edited by IgorDRTZ Thursday, November 17, 2016 6:05 PM
    Thursday, November 17, 2016 5:56 PM