+ Start a Discussion

How to remove query string from current url

I want to remove the query string from the url once i have extracte it in the Controller,

for eg. http://c.cs1.visual.force.com/apex/testPage?param=test

After the controller picks up the param value I want the url to say http://c.cs1.visual.force.com/apex/testPage

How do i do it ?


You'll need to get the browser to open that URL - if you execute an action method that returns a page reference without the parameters, they will be dropped.

Mohamed Arif RasheedMohamed Arif Rasheed
Hi Bob,

on sites.

1. I am redirecting for page 1 to page 2 with query string param passed through page reference method.

2. On page 2 I could see the parameters at this point.

3. On page 2 I have a command button action set to a void method. When this action happens, why my query string parameters are gone?   I want them to be on for ever as long as I stay on that page regards of  any actions on page 2.

Appreciate your help!