vendredi 27 janvier 2017

Get only the query string in current view

I am setting the canonical URL for my Rails site which has many many subdomains that render the exact same content as the main domain.

I am adding this to the top of my layouts:

<link rel="canonical" href="http://ift.tt/2kuDMFL}" />

Which makes sure Google crawlers know the definitive source to help my SEO.

The above code does not include the query string when one exists

I can request.query_parameters and then break that out into a string... but is there an easy way to just get the ?provider=233 query string out of requests?

Aucun commentaire:

Enregistrer un commentaire