Page alias to aggregate and hide query parameters for google indexing
Answered
Masai Lion posted this in #help-forum
Masai LionOP
I have a project where I have games and publishers.
This project has a single indexing page for games where you can pre-set filters.
I want to create one page for each publisher, but I want to use this indexing page template. What's the best approach to do this?
This project has a single indexing page for games where you can pre-set filters.
i.e. /games?publisher=relogicI want to create one page for each publisher, but I want to use this indexing page template. What's the best approach to do this?
i.e. /publishers/relogic would map to -> /games?publisher=relogicAnswered by Western paper wasp
You could use a middleware to rewrite paths of the form
Then, you could add markup to the
/publishers/relogic to /games?publisher=relogicThen, you could add markup to the
/games page to include a <link rel="canonical" href="your-site.com/publsihers/reglogic"> in the <head>, which would ensure search engines index that version rather than the query param version8 Replies
Western paper wasp
You could use a middleware to rewrite paths of the form
Then, you could add markup to the
/publishers/relogic to /games?publisher=relogicThen, you could add markup to the
/games page to include a <link rel="canonical" href="your-site.com/publsihers/reglogic"> in the <head>, which would ensure search engines index that version rather than the query param versionAnswer
Western paper wasp
but you'll need to make sure the page is also accessible by your preferred URL, or the canonical URL won’t work; a rewrite in
middleware.js should be able to take care of that@Western paper wasp You could use a middleware to rewrite paths of the form `/publishers/relogic` to `/games?publisher=relogic`
Then, you could add markup to the `/games` page to include a `<link rel="canonical" href="your-site.com/publsihers/reglogic">` in the <head>, which would ensure search engines index that version rather than the query param version
Masai LionOP
Thank you a lot. This is awesome @Western paper wasp
Just what I wanted to execute but was lost on how to start and what was required.
Just what I wanted to execute but was lost on how to start and what was required.
Western paper wasp
You’re welcome!
Feel free to mark as solution
Masai LionOP
Yeah I forgot this server has this functionality.