- 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.
- 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
So, after lots of Googling and help from Netlify staff, I found the problem:
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/
If you are “rewriting” to a different domain, then you want a redirect instead, I think.
The status should be 301.