close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Map shows on domainname.com but not on www.domainname.com

Thread began 7/26/2011 2:37 pm by ccdantas101117 | Last modified 7/29/2011 6:57 am by Jason Byrnes | 2789 views | 7 replies |

ccdantas101117

Map shows on domainname.com but not on www.domainname.com

I have a site brokeniphones.com that the maps and directions only shows when the domain name is in the url address bar but the when using the full address www.brokeniphones.com the map doesn't show. Wired, because the API is for the domain name which according google will cover any address with or without www.

Can anyone help me figure it what is the problem is a server issue or script issue?

The URL to try with www: location_detail.php?loc=irvine
The URL to try without www: location_detail.php?loc=irvine

Thanks for the help in advance.

Carlos

Sign in to reply to this post

Ray BorduinWebAssist

There are probably two options:

1) add code to the page so that if you go to it with www.brokeniphones.com it would automatically redirect to brokeniphones.com or vice-versa and get the google api code for the now-consistent domain.

or
2) get two api keys and add code to the page to identify which one to use and use a different api key depending on the full domain being used.

Sign in to reply to this post
Did this help? Tips are appreciated...

ccdantas101117

Hi Ray how do I add the second code?

I have the API for both with and without the www.

Sign in to reply to this post

Jason ByrnesWebAssist

you can find the currant servers domain name using the HTTP_HOST server variable:

php:
<?php echo((isset($_SERVER["HTTP_HOST"]))?$_SERVER["HTTP_HOST"]:""?>




Create a switch statement to select which key should be used based on that variable:

php:
<?php

switch ($_SERVER["HTTP_HOST"]) {
  case 
"www.mydomain.com"$key "key1"; break;
  case 
"www.otherdomain.com"$key "key2"; break;
  case 
"www.someotherdomain.com"$key "key2"; break;
  default: 
$key "default key"; break;  
}
?>





then change the script tag that connects to the google api to use the new $key variable:

php:
<script type="text/javascript"  src="http://maps.google.com/maps?file=api&v=2&key=<?php echo $key?>">/*wagmp*/</script>
Sign in to reply to this post

ccdantas101117

Jason Thanks

I have one question if I may ask, the _promaps_geocache.xml page is missing and or not being generated, this also can cause the error correct? This page is auto generated by the php script on the server correct? What can be tha cause of the server not generate it or it is missing?

Sign in to reply to this post

Jason ByrnesWebAssist

to create the _promaps_cache/_promaps_geocache.xml file, the server needs to have sufficient privileges, if the permisions on the server do not allow for read and write, it will deny access to create the file.

try creating the _promaps_cache/ folder manually and setting the permissions for that folder to 755 which would allow for read write access.

Sign in to reply to this post

ccdantas101117

Jason thank you

It was the problem, now works great.
Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...