Multi-language site - one domain or multiple domains? - seo

Which one is the best way to contruct a multi-language site if you want the most effective SEO?
Use a single domain?
www.domain.com/en
www.domain.com/de
www.domain.com/dk
Or use multiple domains, one for each language?
www.domain.com
www.domain.de
www.domain.dk

If you have multi-lingual content you should follow Google's new multi-lingual guidelines. Basically, you use subdomains for the different translations:
To explain how it works, let’s look at some example URLs:
http://www.example.com/ - contains the general homepage of a website, in Spanish
http://es-es.example.com/ - is the version for users in Spain, in Spanish
http://es-mx.example.com/ - is the version for users in Mexico, in Spanish
http://en.example.com/ - is the generic English language version
On all of these pages, we could use the following markup to specify language and optionally the region:
<link rel="alternate" hreflang="es" href="http://www.example.com/" />
<link rel="alternate" hreflang="es-ES" href="http://es-es.example.com/" />
<link rel="alternate" hreflang="es-MX" href="http://es-mx.example.com/" />
<link rel="alternate" hreflang="en" href="http://en.example.com/" />
If you specify a regional subtag, we’ll assume that you want to target that region.
Keep in mind that all of these annotations are to be used on a per-URL basis. You should take care to use the specific URL, not the homepage, for both of these link elements.

Related

SEO - hreflang "no return tags"

I am recently having an increased number of "hreflang no return tags" error on the Google webmaster console and I cannot figure out what I am missing. My site is www.example.com and it can be accessed in different languages as www.example.com/#!/xx, where xx is one of the following options: it, ro, ru, pt, en, es, fr.
My code snippet looks like:
<link view-head rel="alternate" hreflang="x-default" href="{{domain_absolute}}#!/{{mainVars.currentLanguage}}/--about-us" />
<link view-head rel="alternate" hreflang="es" href="{{domain_absolute}}#!/es/--about-us" />
<link view-head rel="alternate" hreflang="pt" href="{{domain_absolute}}#!/pt/--about-us" />
<link view-head rel="alternate" hreflang="ro" href="{{domain_absolute}}#!/ro/--about-us" />
<link view-head rel="alternate" hreflang="ru" href="{{domain_absolute}}#!/ru/--about-us" />
<link view-head rel="alternate" hreflang="en" href="{{domain_absolute}}#!/en/--about-us" />
<link view-head rel="alternate" hreflang="it" href="{{domain_absolute}}#!/it/--about-us" />
<link view-head rel="alternate" hreflang="fr" href="{{domain_absolute}}#!/fr/--about-us" />
And the errors I get from Google are the following:
Original URL : #!/en/some-document
Alternate URLs: http://www.example.com/?_escaped_fragment_=/en and http://www.example.com/?_escaped_fragment_=/en/some-document - no return tags
I get the same errors for all of the supported languages.
What am I doing wrong?
# is a special character. Everything in a URL after the # is ignored.
#! is a special case. If you use #! then Google treats it as a signal to convert it to a different URL for AJAX crawling. This "feature" is deprecated. And your URL structure tells me you are not using #! in this way anyway.
So bottomline: change your URLs so that you are not using #. Give all languages their own URL.
While deprecated, Google is understanding the #! and converting the URL to the escaped fragment version. Since Google is telling you they cannot find the return on the /?_escaped_fragment_ version of the URL this is telling me that your rewrite of the URL to respond to their request is missing the HREFLang Element.
View the source on http://www.example.com/?_escaped_fragment_=/en/some-document and if you don't see the HREFLang string you show in the screen capture that is your problem. Ensure you have it on both versions and YES you should cover it to include the escaped fragment version of the URL and that error will go away.
The alternative I use for sites with more than 5 country/language combinations is to use XML site maps and submit the excepted fragment version.

SEO - Canonical url and multilanguage site

Our website is targeting several languages and countries. We make the choice to use subdomain to manage our URLs. We want to avoid to create duplicate content and canonical issues.The content for www. and en. is identical but we plan to adapt the content for en. (in order to target UK).
For main domain, google is understanding:
<link href="https://www.example.com/" hreflang="en" rel="canonical" data-trid="15">
<link href="https://example.com/" hreflang="x-default" rel="alternate" data-trid="16">
<link href="https://example.com/" hreflang="en" rel="alternate" data-trid="17">
<link href="https://en.example.com/" hreflang="en-gb" rel="alternate" data-trid="18">
<link href="https://fr.example.com/" hreflang="fr" rel="alternate" data-trid="19">
<link href="https://de.example.com/" hreflang="de" rel="alternate" data-trid="20">
For english subdomain:
<link href="https://en.example.com/" hreflang="en-gb" rel="canonical">
<link href="https://example.com/" hreflang="x-default" rel="alternate">
<link href="https://example.com/" hreflang="en" rel="alternate">
<link href="https://en.example.com/" hreflang="en-gb" rel="alternate">
<link href="https://fr.example.com/" hreflang="fr" rel="alternate">
<link href="https://de.example.com/" hreflang="de" rel="alternate">
What is the best practice to avoid any canonical & duplicate content issues?
Thanks for your help!
Common Mistakes
Important: Make sure that your provided hreflang value is actually valid. Take special care in regard to the two most common mistakes:
Missing confirmation links: If page A links to page B, page B must link back to page A. If this is not the case for all pages that use hreflang annotations, those annotations may be ignored or not interpreted correctly.
Incorrect language codes: Make sure that all language codes you use identify the language (in ISO 639-1 format) and optionally the region (in ISO 3166-1 Alpha 2 format) of an alternate URL. Specifying the region alone is not valid. Via / Read:
https://support.google.com/webmasters/answer/189077?hl=en
The best way to avoid duplicates is to create a unique content for each version, if you can't add content now you have to block these pages or sub-domains by robots.txt or by adding a canonical link to the original page which is en.example.com in your case.
when you have content for each version, remove all these changes and make google able to index them.

url rewriting is not working for relative paths

I am a newbie for rewriting url, I have rewritten my url, but it is causing problem for all the relative paths used in the page like
<link href="style/style.css" rel="stylesheet">
<link href="images/icon.png" type="images/ico" rel="icon" />
<img src="images/test.png" id="test">
Even i have applied the following rewrite rule for them, but still i find 404 error in firebug console (first one is working but second is not working for relatvie)
RewriteEngine On
RewriteRule ^raipur/([A-Za-z0-9-]+)/([0-9]+)$ /viewRestaurant.php?raipur=$1&id=$2
RewriteRule ^raipur/([A-Za-z0-9-]+)/([A-za-z]+)/ /$2/
my console screenshot
I had even debugged my rewrite rule into htaccess tester and its working there as required
You links are all relative links. "images/icon.png" instead of "/images/icon.png". Because your url changed its URL base from:
/viewRestuarant.php
Base: /
to
/raipur/something/1234
Base: /raipur/something/
When the browser sees a link like: images/icon.png it needs to prepend a base URL to it in order to know where the resource is located. By default it uses the host and base based off of the URL that it sees in the location bar. Since that's obviously not where any of these resources are, you need to either make your links into absolute URL's like: /images/icon.png or http://example.com/images/icon.png or add an explicit relative URL base into the header of your pages (between the <head> </head> tags):
<base href="/" />

What HTTP header indicates when Index.html has been served?

Excuse the awkward title: I'm building a simple web server (don't ask...) and have this problem:
The browser requests mydomain.com/MyFolder
My server spots this is a folder, so instead, delivers mydomain.com/MyFolder/index.html
All fine so far, except that index.html has link to mycss.css, but the browser requests it as a top-level file mydomain.com/mycss.css instead of mydomain.com/myFolder/mycss.css.
Is there some HTTP header that needs setting up to indicate that a different page has been served? I've tried returning Content-Location: /myFolder/index.html, but without any visible success.
index.html basically contains this:
<link rel="stylesheet" href="mycss.css" />
Return a 301 Moved Permanently status code, instead of the 200.
Provide a Location header pointing to the same url plus a slash in the end /
Like so:
Location: mydomain.com/MyFolder/
Do not serve the index.html file on that same request, wait for the browser to request again with the slash at the end.
Or just try to add something like this to your .htaccess file:
RewriteEngine On
RewriteBase /
RewriteRule ^(.+)$ myFolder/$1
Can you just try to change this:
<link rel="stylesheet" href="mycss.css" />
to this:
<link rel="stylesheet" href="/myFolder/mycss.css" />
?
Ok, actually the information given was not correct so I'm modifying the answer. If you are implementing a web-server, you must follow the standard specification. The definition <link rel="stylesheet" href="mycss.css" /> shall retrieve the the CSS file from the same location as the file in which it is defined in (index.html) is. When using relative paths, it is not the browser that requests from a specific location but the web-server should determine the location from which to serve the resource.
Check section 2.4.6 and 3 in the standards document: http://www.ietf.org/rfc/rfc1808.txt
In other words, if the path of a resource does not start with the slash (/), it is considered as relative and should be located relative to the base URL.

Favicon for all the pages in my website

I've learned that the way to add favicon for a web page is to have the following lines in the page.
<link rel="SHORTCUT ICON" type="image/x-icon" href="http://mysite.com/faviconfilename.ico"/>
<link rel="icon" type="image/x-icon" href="http://mysite.com/faviconfilename.ico" />
Should i add this code in each and every page my site has?? I use Apache - tomcat clustering to serve pages. Is there any other easy way to do this?
It is usually enough to place a file called "favicon.ico" in the root of your website.
You can get rid of the unnecessary processing and traffic as well as the error log entries by using the following Apache configuration incantations:
# Don't bother looking for favicon.ico
Redirect 404 /favicon.ico
# Send custom text instead of sending the custom error page
<Location /favicon.ico>
ErrorDocument 404 "No favicon"
</Location>
Modify the apache config.
upload this file to the root directory of your website. Make sure that it is readable so that apache can read it. If you have shell access, type: "chmod +r favicon.ico".
Then edit httpd.conf and insert the following line:
"AddType image/x-icon .ico"
Your approach works when you don't have access to your apache config. In this case, if you are using any framework then you should add it to your layout/template.
Here is my method for php sites. It ensures that if you update the favicon, it will be updated immediatly when your clients visit your site:
<link rel="shortcut icon" href="favicon.ico?v=<?php echo time() ?>" />