My problem is that I don’t know how to redirect the domain prettybar-blog.netlify.com to prettybar.co/blog since prettybar.co/blog has a 200 redirect (proxy) to the other netlify sites prettybar-blog.netlify.com
So if I add a 301 redirect from prettybar-blog.netlify.com to prettybar.co/blog, I have a “too many redirects” error.
I would like to do that to avoid a duplicate content from Google (+ assets are not found with this url)
Hello,
(I can’t put links because “Sorry, new users can only put 6 links in a post.” ).
I have also tried setting up redirects as instructed (by @jen ) but it doesn’t work.
My main site is myOwnDomain => netlifyDomain (with custom domain and redirections from netlify to my own).
My blog site is blogMyOwnDomain => blogNetlifyDomain (same redirects).
With
# 360demain.netlify.app netlify.toml
# Redirections
[[redirects]]
from = "https://360demain.netlify.app/*"
to = "https://360demain.com/:splat"
status = 301
force = true
[[redirects]]
from = "http://360demain.netlify.app/*"
to = "http://360demain.com/:splat"
status = 301
force = true
# https://answers.netlify.com/t/support-guide-can-i-deploy-multiple-repositories-in-a-single-site/179
[[redirects]]
from = "/blog/*"
to = "https://360demain-blog.netlify.app/:splat"
status = 200
force = true
Request myOwnDomain/blog lead to blog.myOwnDomain (but I want to continue on myOwnDomain/blog…).
when I add
# 360demain-blog.netlify.app netlify.toml
# Redirections
[[redirects]]
from = "/*"
to = "https://360demain.com/blog/:splat"
status = 301
force = true
On blogMyOwnDomain’s netlify.toml, I have a “too many redirects” error.
How can I fix that ?
My goal is to prevent blogNetlifyDomain or blogMyOwnDomain from being indexed. I would like to keep the unique url myOwnDomain/blog/* for this git repository.
In testing a ways to overcome this (there are methods mentioned throughout these forums) the best I have figure out it the following:
Don’t publish the site you are proxying to at the domain root. So if you are using /blog as the path, publish the original site to /blog (e.g. 360demain-blog.netlify.app/blog)
On the proxied site (e.g. 360demain-blog.netlify.app) instead of having a redirect like
/* https://example.com/blog/:splat 301!
or
[[redirects]]
from = "/*"
to = "https://example.com/blog/:splat"
status = 301
force = true
[[redirects]]
from = "/*"
to = "https://example.com/blog/:splat"
status = 200
[[redirects]]
from = "/*"
to = "https://example.com/blog/:splat"
status = 301
force = true
The first allows anything on the blog path through while redirecting everything else to redirect. As there is no content on the homepage, there is nothing to get indexed. Also add a canonical link (e.g. <link rel="canonical" href="https://example.com/blog/">) and refresh <meta> to the (otherwise) blank /index.html on the blog site.
Thank you very much !
It was difficult to figure out how to adapt this suggestion to my static site generator (Hugo) but it’s now ok I believe: blog.360demain.com => returns a 404 error blog.360demain.com/blog is accessible but not indexed by search engines (and I can manage it via /admin with Netlify CMS for example on blog.360demain.com/admin).
The public site 360demain.com/blog is operational.
Perfect !
Now we have to code…