Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialOziel Perez
61,321 PointsDo rewritten urls count as separate pages?
I'm currently doing website translation using PHP and a MySQL database. I was going to rewrite my urls so that it looks as if there's a subfolder for the spanish language. Example:
English: http://www.example.com/rewritten_url/ Spanish: http://www.example.com/spanish/rewritten_ul/
I already know how to do rewrite rules, specifying GET variables and all that stuff necessary for this to happen. My questions are about SEO. Using the two urls that I mentioned above, do these urls act as if they are 2 separate pages or will the Google bots recognize that it's one page but a different url? If it's 2 pages, should I then specify on my sitemap.xml file that I have these 2 pages? and lastly, even if I didn't do rewrite rules, and left the get variables on the urls, would they still count as 2 pages?
I don't know a whole lot about SEO other than what I learned in the SEO Basics video, so I was just curious as to my approach. On a side note, for good user experience, is it better to continue using PHP and the database for translation, or should I consider AJAX to retrieve a translation and place it on the page. I ask these questions here on these forums since I already tried googling around for answers but I keep getting Google Translate API in the search results and that's not what I'm looking for.
1 Answer
moonshine
8,449 PointsI belief this article answers the question: https://support.google.com/webmasters/answer/182192?hl=en.
Based on this article it seems that Google would treat these URLs as separate and target each link to an appropriate audience. Include a sitemap, and for each additional language specific link use a rel="alternate" attibute in your sitemap.
Whatever is most reliable, fastest and simplest to a user is probably the best user experience. Otherwise, it's possible to use both PHP and AJAX because: AJAX → PHP → database.
Oziel Perez
61,321 PointsOziel Perez
61,321 PointsThanks for the article, I was having a hard time finding a source that would explain this well. As for the sitemap, sounds perfect. I can just add the spanish urls there and resubmit to google and bing.