Question

My site has webpage urls that use the following format:

www.mysite.com/id/pretty_title

The front page links to these pages, but the href actually contains some parameters:

 www.mysite.com/id/?some_ugly_parameters_to_let_me_know_what_search_it_is_from

This then redirects to

www.mysite.com/id/pretty_title

which shows the page.

My issue is that Google's search results show the link to the page as the ugly one instead of the pretty redirected one. Besides looking ugly, it can cause errors because the parameters that are included in the ugly link are irrelevant to a user who directly enters a page from Google.

Can I get Google to only use the final redirect url? Or otherwise avoid this issue? I do need to pass these parameters along. Storing info in the session won't work because a user can have several tabs open.

Was it helpful?

Solution

On the "ugly URL page" you put <link rel="canonical" href="www.mysite.com/id/pretty_title"> which tells the search engine your preferred URL for that content.

Can also set www.mysite.com/id/?some_ugly_parameters_to_let_me_know_what_search_it_is_from to have a 301 redirect to your pretty URL

Canonical URLs: https://support.google.com/webmasters/answer/139066

301 Redirects: https://support.google.com/webmasters/answer/93633?hl=en

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top