I'm trying to get my website indexed on google for the past couple weeks(takes a bit of time between submitting a 'fix'). I've been having trouble with different issues regarding redirects and canonical. I've looked around for information regarding SEO, Meta tags and bot tags.

My website is multi langual with sub directories and a root index.php with a redirect using $_SERVER['HTTP_ACCEPT_LANGUAGE'] and switch case.

The structure is pretty simple

-domain.ca/index.php -redirects to $_SERVER['HTTP_ACCEPT_LANGUAGE']


For some reason google won't let me index the index.php with the redirect from the root and is also giving me cannonical errors on the pages.

<link rel="canonical" href="https://www.domnain.ca/en/index.html"/>  
<link rel="alternate" hreflang="en-CA" href="https://www.domain.ca/en/index.html" />  
<link rel="alternate" hreflang="fr-CA" href="https://www.domain.ca/fr/index.html" />  
<link rel="alternate" hreflang="x-default" href="https://www.domain.ca/en/index.html" />

this is an example of the English version of index.html canonical/alternate. I was unable to find relevant information on the best way to setup multilangual website with a redirect.

What I'm ultimately wondering is what would be a good way to set it up for indexing.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.