Mobile app version of vmapp.org
Login or Join
Murray155

: Canonical or redirecting When I have a page with the URI lets say www.example.com/page there might be the possibility that users or links end up sending the user to pages like this: www.example.com//////page?

@Murray155

Posted in: #CanonicalUrl #Redirects #Seo

When I have a page with the URI lets say example.com/page there might be the possibility that users or links end up sending the user to pages like this: example.com//////page?
I could just use a canonical on the page which refers to example.com/page, but my fist question is whether a redirection via PHP with:

header ("Location: www.example.com/page )

might be more useful. It is definitely more user-friendly, which should be the overall goal.

My second question now is, in case I use the canonical, should I include the canonical tag into the page standard html or should I just put it in there via PHP if the canonical differs from the current page URI?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Murray155

1 Comments

Sorted by latest first Latest Oldest Best

 

@Michele947

The redirect is the better solution, as it stops the erroneous URLs ever being linked to or shared, and so should help crawl efficiency (i.e., search engines shouldn't have to crawl multiple non-canonical versions of pages, thereby wasting time that could be spent elsewhere on your site).

I'd do your redirects on the server though, if possible. A fairly simple regular expression will catch all manner of undesirable URL variants (e.g., jumbled case, with and without trailing slash, etc.).

You don't need to apply the canonical link element conditionally: it can always be there, regardless of whether the page is being shown on a non-canonical URL or not. Even Google do this.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme