PageId property in context object causing crawling errors and exposing project structure #2277
Unanswered
yeraydavidrodriguez
asked this question in
Help & Questions
Replies: 1 comment 8 replies
-
That's quite unexpected: I expect bots to only crawl
I can't think of a reason why it would be an issue. How is this an issue for you? |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello all.
We have developed a corporate website that serves content from a headless CMS using Vike.
However, examining our Google's search console reports, we saw some crawling errors because Google tried to index the URL domain/src/pages/@slug.
We think that the cause for this is that Vike is adding the following attribute to its vike_pageContext object:
"pageId":"/src/pages/@slug"
This makes Google (and other robots) think that is a route and tries to index it. But also, it is exposing an internal of the project we would like to keep hidden (the file structure of the project)
We tried to overwrite that property on the onBeforeRender function, but it generates an error as is required by the Vike router.
Is there some way Vike can be configured so that the PageId property is excluded from the context without affecting the router, or at least having it obfuscated?
Beta Was this translation helpful? Give feedback.
All reactions