skip to Main Content
  1. I want to “rewrite” in Netlify so that https://portofolio-ion-varsescu.netlify.com/ will be shown when going to https://www.ionvarsescu.tk/portofolio/. It doesn’t work. I’ve tried all I found on the net.
  2. After it will eventually work, how does 200 rewrite impact SEO? Where do the crawlers see the content, on my custom domain (https://www.ionvarsescu.tk/portofolio/) or on my sub-domain (https://portofolio-ion-varsescu.netlify.com)? Is it duplicate content?

I have the free Netlify plan, both sites are run on my Netlify account from 2 different github repositories. I’ve tried using the 200 rewrite in all the combinations I could think of by editing the netlify.toml in the https://www.ionvarsescu.tk github repo. This is the last of the many combinations I’ve tried:

   [build]
   publish = "public"
   command = "npm run build"

   [[redirects]]
   from = "https://portofolio-ion-varsescu.netlify.com/*"
   to = "/portofolio/:splat"
   status = 200
   force = false

As mentioned, the rewrite doesn’t work, I get an error when going to https://www.ionvarsescu.tk/portofolio/

Thank you for the help.

2

Answers


  1. Chosen as BEST ANSWER

    So, after lots of Googling and help from Netlify staff, I found the problem:

    1. The correct code should be
       from = "/portofolio/:splat"
       to= "https://portofolio-ion-varsescu.netlify.com/*"
    

    I've written a blog post about it, it might help you. https://www.ionvarsescu.tk/blog/2019-01-19-using-netlify-redirect-301-and-rewrite-200/

    1. The effect on SEO is small (shouldn't matter, that's what Netlify staff informed me).

  2. If you are “rewriting” to a different domain, then you want a redirect instead, I think.

    The status should be 301.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search