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
Suresh KalluriSuresh Kalluri 

restricting the user from changing the url

Hi All,

I am having community with custom login, for external users.
Once their login is successful, they will be redirected to a visualforce page.If they modify the url, they will be shown the OOB community page, with Home tab etc.

I want to restrict the logged in user from changing the url.
Could you guys help me with this?

Thanks.
Vinita_SFDCVinita_SFDC
Hi,

You can not stop users from editing URL on browser. Neverthless, you can restrict users from accessing other VF pages by removing access on VF pages from their profile.
Suresh KalluriSuresh Kalluri
Hi Vinita,


Thanks for your reply.
My landing page will be a visualforce page. When the user changes the url, for ex say: by adding /s then he will be shown 'an error message will be shown to user stating that URl does not exist' and he will be shown to Salesforce Home tab, in the community.

But I dont want him to see any other page other than the visualforce page they will be entering after their succeful login.


We can remove access for vf pages, other than the intended. How to prevent them from seeing the out of the box community.

Thanks
Suresh KalluriSuresh Kalluri
Is there any way to log them out, if they modify the URL..similar to banking sites??
 
Vinita_SFDCVinita_SFDC
Hi,

You can make a check in controller, if profile is guest and current page URL != "the landing page url" then logout the user.

get current page url :  ApexPages.currentPage().getUrl()
For logout : connection.logout();

Refer: http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_calls_logout.htm
Suresh KalluriSuresh Kalluri
Hi Vinita,

https://sampleCommunity is my login page.
https://sampleCommunity/apex/page1 is my landing page.

If the user changes the url, https://sampleCommunity/s , he will be able to see the out of the box Home tab.

Could you tell me, where i can check the things you have mentioned?