What is best for SEO when using Ajax, Hash URL or Direct URL or Both?
-
16-06-2021 - |
سؤال
I'm making a website based fully on Ajax, but i'm still doubting about my SEO.
In my "a" tags href I put a Direct link to the content, but i don't redirect the user to it, instead i get the content by Ajax, then I change the Address bar with "window.location.hash".
If i send to Google my sitemap with the two links (the hash link and the direct link) is that going to be a duplicate content and hurt my SEO or not.
If you have any better way to do this (instead of my way) please feel free to tell me about it.
Thanks Guys
المحلول
Google has a useful guide here:
نصائح أخرى
For full ajax sites, you'll typically see the navigation of the site reflected in url hashes:
#/about
or #/faq
and so on. When that is the case, google will index the content of those ajax responses if you prefix the url structure with an exclamation point (!). This is called a hashbang. so:
#!/about
would actually get indexed by google.... also you can throw those types of urls into your sitemap (i think)