I have a force.com site with custom url for my web2lead just say www.company.com/step1. i want redirect it to www.company.com/step2 after button clicked but it redirecting to www.company.com/step1/step2.
here's my PageReference
public PageReference Next(){
web2lead.Name = firstName+' '+lastName;
web2lead.Phone__c = phone;
web2lead.City__c = city;
web2lead.Company__c ='Keluarga '+firstName+' '+lastName;
web2lead.Email__c = email;
insert web2lead;
web2leadId = web2lead.Id;
PageReference step2Form = new PageReference('/step2');
step2Form.getParameters().put('id',web2lead.Id);
step2Form.setRedirect(true);
return step2Form;
}
did i doing something wrong ? because i don't want to put full url to PageReference like PageReference('http://www.company.com/step2');
. can i do that ?
PageReference step2Form = new PageReference('step2');
?PageReference step2Form = new PageReference('../step2');
Normally what the../
does is goes back a level in most languages I've used.www.company.com/step1/step1