I believe the last <\/script> it’s a typo on google docs about this? And should be </script> only? Or Am I wrong?
This, will generate a script tag, but, on our case, we are using zend to Append that information to the head of our view, so, I’m unable to see how can I integrate this solution given by google, and Zend
$this->headScript()->appendFile
in order to have the map to work without warnings on both: www.something.com and www.something.pt .
Can I have your help here?
Márcio
Why can’t I think like that?! :S Seems quite nice.
I will generate the keys for http://example.com and http://example.pt (without the www), they will work with www, so your solutions seems to be valid;
Still one question:
Even if the user doesn’t type www on the browser, will http_host grab the www part?
Thanks a lot, finally I see a light for taking that annoying alert
Márcio
FWIW, if you use the new Version 3 of Google Maps you don’t need to submit a key any longer.
You’ll have to rewrite just about every line of code you used, but its likely to be a lot shorter, and push you to rely on KML a heck of a lot more than you did previously.
If they have the same content you should definately redirect all domains to one. That way you get all SEO “juice” on one domain, instead of spread out over several.
Another bonus:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\\.example\\.com$ [NC]
RewriteRule (.*) http://www.example.com/$1 [L,R=301]
Replace the code I showed you earlier with the above to redirect example.com, example.pt and www.example.pt to www.example.com
PS. .pt? Are you from Portugal? If so, your english is really good :tup:
Scallio - it worked like a charm. And know that I think of it, probably even one google map key would be enough if we use .htaccess to redirect all the access from www.example.com or example.com to example.pt for example.
But I’m glad like it is. Thanks a lot for the .htaccess bonus.
It’s not just for google maps, it’s recommended by google for SEO as well afaik (make either the www or the non-www version of your domain the canocical domain).
You could of also use (if you don’t feel like fiddling with the .htaccess stuff):
or use any of the preg_* functions to find the domain name, or strrpos, or substr solutions, or …
However, I’d personally recommend the .htaccess aproach to direct non-www to www, or the other way around if that has your preference
If the user doesn’t type www HTTP_POST won’t take the www part. But it’s always advisable to have one 301 redirect to the other using .htaccess (if on Apache) or ISAPI_Rewrite (if on IIS)
The code for Apache is as follows (code for ISAPI_Rewrite is similar I believe):
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [L,R=301]
To redirect all non-www requests to www-requests (like SitePoint does).
I really need to read more about SEO myself, I’m quite ignorant on that matter.
I prefer to learn fishing. But I will not refuse the fish, if that don’t stop me from learning. Thanks a lot.
Yes I am. But I believe it isn’t a good english at all. Really. Is no fake modesty or something.
But even in Portuguese I could be writing so much better. But it’s a quest that not many can do. Still, and anyway, I believe it’s enough to write here, and clarify my doubts.
ps - You seem to be a non-native English speaker yourself. Fellow european. Oh well… S’on peux pas parler le francais dans tout l’europe, alors… ça nous reste que le faire en anglais, je soupçonne
Voilà, un bonus.