+ Start a Discussion

Can custom web address be mapped to URLs with sub domains?

Imaging this scenario.


I have a massive corporate website at www.mysite.com.

I have created a force.com site called PRM and it's standard URL is http://mysite.force.com/PRM.

It has a page like this: http://mysite.force.com/PRM/contact.


Is it possible to map this site to something like http://prm.mysite.com/prm/contact ?




only possible with the pilot url-rewriter feature

So with that in mind perhaps you can answer this.


Most of the force.com pages will be iframes embedded in www.mysite.com. This works just okay. The biggest problem is these pages are hosted on different domains and javacript cannot access or manipulate the parent page from the iframe. 


Nearly all of these iframe sites are simple web forms that will allow us to do complex lead assignment and validation on existing records before insertion. Some times there will be an error on the page, such as a field is required. I currently have a message on the field and at the top of the page saying, "Please fix errors below". Problem is I can't scroll the page to the top for the user to see this message. Depending on the size and location of the error, the user won't know what is wrong and they may not see the error messages.


Do you know if an iframe in www.mysite.com with a src of "http://prm.mysite.com/prm/contact" will be able to interact with the parent page or is this simply masking the URL and the javascript will know they are on two seperate domains; force.com and mysite.com.




Message Edited by TehNrd on 01-28-2010 01:35 PM

If you want to use




Where contact is the name of your visualforce page, that will work without any rewriting. 


Two levels in the site path, http://prm.mysite.com/prm/contact will not work.

Not following. How would you set that up?

Ryan has a point. I thought you wanted to have a path "prm".

But I see our required field on the default web address is confusing.

You can create a site without a path. But once you have more than one site you have to start specifying value for the path. 


So I can map http://mysite.force.com to http://prm.mysite.com with no issues?


We would create a CNAME for for thse two and then the Custom Web Address value would be "prm.mysite.com"?




yes, create a cname to point prm.mysite.com to mysite.force.com

wait until cname is in place globally (we do a dns check when you try to populate site custom web address)

then drill down to the site with no path and populate the custom web address field 


On the last step, the custom web address would be, "http://prm.mysite.com" or "prm.mysite.com"?


To confirm, if we do this we will only be able to map one force.com site to a subdomain as any other force.com sites created after this must have custom defualt web address, which will create a path, and these can't be mapped to sub domains.


And finally, once this is setup do either of you know if script in an iframe that contains the force.com site will be able to interact with the parent page?


Sorry for the plethora of questions but I will have to work with IT (I'm in sales development) and I need to get my facts straight before I approach them about implementing this.


Thanks for all the help,


Message Edited by TehNrd on 02-08-2010 10:04 AM

let me try to clarify


your domain is mysite.force.com and this is registered at your org level


then depending on the edition you have you can create up to 25 sites in your org

and each site must have a unique default web address, the the uniqueness is based on the path value 

site 1: mysite.force.com/

site 2: mysite.force.com/pathA 


site 25: site 2: mysite.force.com/pathZ


each site url can be mask with a custom domain name (these values must be unique, you can't use the same custom domain name for multiple sites)


all of these custom domain names (or subdomain names) will be cnamed to your org level mysite.force.com domain name. However, you need to populate the custom web address values at the site level


so the custom domain name takes you all the way to your org, and we use the custom web address value to figure out which site we need to display.




For the part related to iframe interacting with the parent page...

Seems like might work

you would need to set 


document.domain = "mysite.com";





here is a related article


Message Edited by Bulent on 01-28-2010 04:10 PM

Ok, I think I got this....maybe.


No path: (no Default Web Address)

"mysite.force.com/" masked to "sub.mysite.com/".


sub.mysite.com.        CNAME  mysite.force.com. 

Set custom web address as "sub.mysite.com".

Access a page like this, " http://sub.mysite.com/page



Site with path:


"mysite.force.com/path" masked to "subA.mysite.com/".


subA.mysite.com.        CNAME  mysite.force.com. 

Set custom web address as "subA.mysite.com".

Access a page like this, " http://subA.mysite.com/page






Message Edited by TehNrd on 01-28-2010 04:43 PM
you got it!

Hurray! Thanks!


I've been reading about cross domain scripting all day, and I think it will work, but will report back if we get this up and running.


Very good info Bulent, thank you.


My question is what happens with SSL?


I have a client where we are rolling out a Site authenticated Customer Portal. They would like to use their own custom domain name with a CNAME entry, which is what the docs say and is illustrated by the previous posts.



sub.mysite.com.    CNAME  mysite.secure.force.com.


The idea being that: https://sub.mysite.com/thesite is masking https://mysite.secure.force.com/thesite



If this does work (which I will tray asap) with SSL, what would the domain be on the digital certificate request?





CNAME'ing to the secure site will not work.