Reputation: 171
I'm using React app for web development and there is a concept called "share company profile". While sharing the URL it shows something went wrong and in the LinkedIn post inspector it show like below: But on Facebook it works fine since it's a React app. I have placed all meta and
OG
tags in index.html
itself.
while giving the base url in inspector its working fine but with params like /company/IN-Gowtham-28/
not working
Upvotes: 1
Views: 457
Reputation: 160
If that is a valid URL and your app is a SPA (single page app) made with react, the only thing I can think of is your default redirection. Let me explain:
A react SPA creates only 1 page (/index.html) which includes your entire app, including the router and subsequent pages. so if you try to load /another/page/ that will return a 404 as there's no HTML file at the location. In order to avoid that, your web server should redirect all HTML requests to /index.html. depending on your server or hosting of choice there are several ways to do that. from there, react (react-router) will show the proper page depending on URL location.
Upvotes: 2