How to use a Visualforce page as a Component Lightning Community page?

Hello , I have a button in Lightning component and on click of it I want to redirect to a VF page. I am able to do that in App view , But when I drag the component into the community builder , it gives 404 error. and it does not work the way it should

Component Code

<input class="btnCss" type="button" name='button' value="Continue" onclick="{!c.getNextPage}"/>

Controller Code window.open("MyURL");

Issue is not with href or window.open , Issue is with community builder not allowing to open external pages .

Any suggestions/solutions

  • I believe to access your vf from community builder you need to exposed that vf page as site, then give the url of that site. Community runs on different domain – salesforce Developer Oct 7 '17 at 6:25

Have you tried using force:navigateToURL . This is give exactly what you are trying to achieve.

navigate : function(component, event, helper) {

//Find the text value of the component with aura:id set to "address"
var address = component.find("address").get("v.value");

var urlEvent = $A.get("e.force:navigateToURL");
  "url": 'https://www.google.com/maps/place/' + address


  • This only works in one.app container. Do you know a way to redirect to VisualForce page from Lightning Application that is embedded in VisualForce page too? – Chris Ciszak Mar 27 '17 at 10:59
  • You can always use, Javascript redirect window.parent.location ='/006'; – Pranay Jaiswal Mar 27 '17 at 12:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.