function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
slaneslane 

Right way to create intern al URLs / page references?

Hello all:

 

I have a site, and I have it mapped to the path /SS/. In other words, in my sandbox, the URLs all begin with http://mydomain.dev.cs0.force.com/SS/. This comes about because I filled in a suffix for the "default" web address when setting up the site.

 

In production, I have a custom domain set up. So the site is intended to appear at www.mydomain.com. The user can log in fine, but when they try to navigate the site, the internal links are pointing to www.mydomain.com/SS/somepage. These pages aren't getting found.

 

I wonder if the problem is because I am using the /SS/ prefix in my internal links, and when constructing PageReference objects. Should I not be doing that? Should I be doing something like PageReference.Somepage instead?

 

I guess the other thing I find puzzling is that it would appear that if you use a custom domain the suffix you specified isn't preserved -- is that the case?

 

Anyway, my bigger concern is how to construct the internal links so the site is portable.

Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent

Yes, your custom domain name masks the entire site url (site domain name + path).

And each site can have a unique custom domain name (not the same one for all your sites) 

 

You can create up to 25 sites. The reason you create multiple sites shouldn't be to get different directory names.

The reason you create sites is to have different custom domain name, different branding, security settings, and login settings.

 

We have a URL re-writing pilot feature where you can create your own friendly urls with n number of directory paths.  

If you are interested in this pilot feature please send me an email. 

All Answers

BulentBulent

use relative urls and do not hard code any prefix in your code.

URLfor and page references understand the site context vs. internal context 

Message Edited by Bulent on 11-15-2009 08:42 PM
slaneslane

Excellent, I think I have a pretty good handle on how best to create the internal links now.

 

I'm still puzzled as to why my site suffix seems to disappear under a custom URL. Is that by design? Is the intent that the custom url completely replaces the force.com URL, suffix included? If so that seems to suggest that you can't configure multiple sites under a single custom domain, which seems odd, so I'm likely missing something.

 

-- SGL

BulentBulent

Yes, your custom domain name masks the entire site url (site domain name + path).

And each site can have a unique custom domain name (not the same one for all your sites) 

 

You can create up to 25 sites. The reason you create multiple sites shouldn't be to get different directory names.

The reason you create sites is to have different custom domain name, different branding, security settings, and login settings.

 

We have a URL re-writing pilot feature where you can create your own friendly urls with n number of directory paths.  

If you are interested in this pilot feature please send me an email. 

This was selected as the best answer