[feature request] Redirect render a hidden a tag to support SEO.
See original GitHub issueCan I do it?
const app = <StaticRouter context={context}>XXXXXXX</StaticRouter>;
const stream = renderToNodeStream(app);
stream.pipe(res);
stream.on('end', () => {
if (context.url) { res.redirect(context.url) }
});
No, I can not.
HTTP doesn’t support Redirect in the middle of body.
But I want to use renderToNodeStream to shorted uses’ waiting time. I want SSR for SEO too.
But many crawlers of the search engine don’t support js. They don’t know to redirect to another url without HTTP status 302.
So, why not give them an a tag?
Then:
- Browser receives node_stream, and hydrate, and found
<Redirect to={xxxx}/>, then redirect. - Crawler receives node_stream, found an
atag, crawl it.
Or leave what to render to user: <Redirect to={xxx}>{url => <a style={{display:'none'}} href={url} />}</Redirect>
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
[feature request] Redirect render a hidden a tag to support ...
No, I can not. HTTP doesn't support Redirect in the middle of body. But I want to use renderToNodeStream to shorted uses' waiting...
Read more >Redirects and Google Search
Redirecting URLs is the practice of resolving an existing URL to a different one, effectively telling your visitors and Google Search that a ......
Read more >Ultimate Guide to Redirects in Technical SEO
From an SEO perspective, redirects are a way to preserve the ranking signals from the original page, which can help maintain the rankings....
Read more >React SEO: Best Practices to Make It SEO-Friendly - Ahrefs
However, developments in both how Google and React can render JavaScript ... If you used a JavaScript feature that Googlebot didn't support, ...
Read more >The Website Migration Guide: SEO Strategy, Process, & ...
The redirects implementation is one of the most crucial activities during a site migration. If the legacy site's URLs cease to exist and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Yes, that would work.
@timdorr You mean?