Can I change the URL Parameters ?

More
1 month 1 week ago #202374 by OngJunYew
Hi,

I just want to know can i shorter my URL paramters from "http://localhost/survey/11?token=zxc123&lang=en" to something like this "http://localhost/survey/11?=zxc123" ?

- delete the token text from the url
- delete the lang=en from the url

Thank You

Please Log in to join the conversation.

LimeSurvey Partners
More
1 month 6 days ago #202380 by jayat
Hi,

you can delete the lang from the url ( i do this often becouse i have only one language)
you need the token to start the survey or you make the survey avalibel for all

regards
jan

Please Log in to join the conversation.

More
1 month 6 days ago #202382 by OngJunYew
Hi, thanks for your reply

Basically, I need to run my survey with token and two different language. Will I able to shorten the URL as have stated ?

Thank You

Please Log in to join the conversation.

More
1 month 6 days ago #202383 by jayat
if you delete the token part the user must type in the token to start the survey and so he need the token
without the language it starts with the main language of the survey (i think) when the user can change the language he can decide
I don’t know the test setting but maybe you can use a QR code to start the survey
Or you can use short url for each token

Please Log in to join the conversation.

More
1 month 6 days ago #202384 by Joffm
No,
because you may add several parameters, the application has to know to which variable the value belongs.
As you may change the order of parameters, the name of the parameter is necessary

Like
survey.mylime.com/123123?lang=de&newtest=Y&token=abc&myParam=ZZZ111
survey.mylime.com/123123?token=abc&myParam=ZZZ111&newtest=Y&lang=de

So not shorter than "survey.mylime.com/123123?token=abc"

Regarding the language:
If you have the language of the participants in the participant table it's not necessary to add it to the url.
The survey starts with the language of the participant table.

Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 month 6 days ago #202421 by OngJunYew
Hi,

Then is there anyway to delete the language parameters from the URL? Because I have the language of the participants in the participant table.

Thank You

Please Log in to join the conversation.

More
1 month 6 days ago #202426 by OngJunYew
Hi,

Is there any solution to change the variable name "token" to another variable name as well such as only one alphabet "t".

Thank You

Please Log in to join the conversation.

More
1 month 6 days ago #202430 by DenisChenu
If you use apache (seems to be) : you surely can use rewrite , maybe something like this 123123-XXXX rewritten to sid=123123&token=XXXX

httpd.apache.org/docs/current/en/rewrite/intro.html

Else you can update your config to manage the rules of the url manager
www.yiiframework.com/doc/blog/1.1/en/final.url

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development . I don't answer to private message.

Please Log in to join the conversation.

More
1 month 6 days ago #202433 by Joffm

Then is there anyway to delete the language parameters from the URL? Because I have the language of the participants in the participant table.


You read my answer?

If you have the language of the participants in the participant table it's not necessary to add it to the url.
The survey starts with the language of the participant table.


And your second question:
I could imagine you have to change the source code.

As I don't know why you want to do this, you could workaround by:
create a small php programm - called "index.php" in subfolder "s".

Reach by "localhost/s/?t=ABCabc" (and this is really short)

this only grabs the t-parameter and calls your survey with the correct syntax.
Rough example - without validation
<?php
//SurveyID is hardcoded
$surveyID=123456;
if (!isset($_GET["t"]))
{
  $token=$_GET['t'];
 header ("Location: https://survey.myLimeserver.com/".$surveyID."?token=".$token);
?>


Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

More
1 month 6 days ago #202436 by OngJunYew
Hi joffm,

Thanks for your reply.

I already figure it out how to delete the lang="en" parameter in the URL and the Survey will show the page based from the language of the participants in the participant table.

Now I just hope that I can make the variable name "token=" to something shorter such as "t=" to have a short and clean URL.

Thank You.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now