Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Use a local URL-shortifyer

  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 7 months ago - 2 years 7 months ago #219342 by tammo
Use a local URL-shortifyer was created by tammo
A link for a survey has the following structure:
my.website.xx/index.php/123456?lang=en and possibly some extra characters for the token and or fields for prefilling.
I would like to make this shorter, like:
my.website.xx/JYRECJ
Of course URL shortening can be done via an external service, but that may be seen as a privacy issue, just like using Google fonts of Google Analytics.
I looked around and found some possible solutions, but since I am not a coder, I have no idea how to implement these features in LimeSurvey.

And to expand them, for example when using tokens, to something like:
my.website.xx/JYRECJ/UHNNJI where the last part is the token.
Has anyone experimented with this? What are pros and cons?

Tammo
 


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
Last edit: 2 years 7 months ago by tammo. Reason: typo
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #219353 by DenisChenu
Replied by DenisChenu on topic Use a local URL-shortifyer
htaccess redirect for a one time process ?

Else : to have a cleaner solution :
need a plugin can you test my.example.org/123456?lang=en to check if url rewriting work ?

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.
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 7 months ago #219374 by tammo
Replied by tammo on topic Use a local URL-shortifyer
Hi Denis,

of course I can use a .htaccess rule. But I want to give users a possiblity without using difficult (for them) statements.

Use case: LimeSurvey installation for use by communication professionals, not IT

I do not understand the second part of your post.

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #219377 by DenisChenu
Replied by DenisChenu on topic Use a local URL-shortifyer
For the second part : if url rewriting without index.php didn't work : there are no way to interrupt example.org/mylilurl
If url rewriting work : a plugin can do something.

Else another way :
github.com/ldidry/lstu
framagit.org/fiat-tux/hat-softwares/lstu

Sorry : french manual : docs.framasoft.org/fr/lstu/

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.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 7 months ago #219381 by tpartner
Replied by tpartner on topic Use a local URL-shortifyer
Removing index.php:

Code:
'urlManager' => array(
  'urlFormat' => 'path', 
  'rules' => array(
    // You can add your own rules here
  ),
  'showScriptName' => false, // Set to false to remove /index.php from the URLs
),

- manual.limesurvey.org/Optional_settings#URL_settings

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu, tammo
The topic has been locked.
  • tammo
  • tammo's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
2 years 7 months ago #219400 by tammo
Replied by tammo on topic Use a local URL-shortifyer
Thank you. That is a good first step.


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
More
2 years 6 months ago #220592 by davebostockgmail
Replied by davebostockgmail on topic Use a local URL-shortifyer
Could you not just use php to read the token and redirect?

Example 1 : no token

filename on my.website.xx : JYRECJ.php

Address my.website.xx/JYRECJ.php

with the content

<?php

header("location: https://server/index.php/surveyID?newtest=Y");

?>


Example 2 : with token

filename on my.website.xx : JYRECJ.php

Address my.website.xx/JYRECJ.php&t=UHNNJI

with the content

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

$tokenID=mysqli_real_escape_string($db,$_GET);

header("location: https://server/index.php/surveyID?token=$tokenID}&newtest=Y");

?>
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose