Welcome to the LimeSurvey Community Forum

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

shorter url of the survey

  • mrli999
  • mrli999's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
10 years 2 months ago #103082 by mrli999
shorter url of the survey was created by mrli999
I created a survey which's sid is 546753.

And when access www.domain.com/survey.546753.php , I come to list page of this survey. Then I have to click the name to enter the survey.

Is it possible for me to directly enter the survey using www.domain.com/survey.546753.php ? And how?

Is it possbile through edit the config.php or routes.php?

Thanks.
The topic has been locked.
More
10 years 2 months ago #103083 by supercosh
Replied by supercosh on topic shorter url of the survey
Hi

Yes you could:
www.example.com/index.php/789456

Or if you use tokens:
www.example.com/index.php/789456?token=ABCDEFG

Regards
Gregor
The following user(s) said Thank You: mrli999
The topic has been locked.
  • fransmarcelissen
  • fransmarcelissen's Avatar
  • Offline
  • Premium Member
  • Premium Member
More
10 years 2 months ago #103084 by fransmarcelissen
Replied by fransmarcelissen on topic shorter url of the survey
Hi,
Is www.domain.com/index.php/546753 what you are looking for?
Frans
The following user(s) said Thank You: mrli999
The topic has been locked.
  • mrli999
  • mrli999's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
10 years 2 months ago #103085 by mrli999
Replied by mrli999 on topic shorter url of the survey

fransmarcelissen wrote: Hi,
Is www.domain.com/index.php/546753 what you are looking for?
Frans


The limesurvey system is install in the directory: www.domain.cm/survey/

And we did can access the survey through: www.domain.com/survey/index.php/789456 , but the address is a little long.

I tried to access the survey through: www.domain.com/survey/789456.php , but come the list page, I hope can directly access the survey, not the list page.
The topic has been locked.
  • fransmarcelissen
  • fransmarcelissen's Avatar
  • Offline
  • Premium Member
  • Premium Member
More
10 years 2 months ago - 10 years 2 months ago #103086 by fransmarcelissen
Replied by fransmarcelissen on topic shorter url of the survey
Hi,
If www.domain.com/survey/index.php/789456 is too long, you could create a file like www.domain.com/mysurvey.php (probably /var/www/mysurvey.php), with a redirect as content (
<?php
header('Location: www.domain.com/survey/index.php/789456 ');
?>
Now you can access the survey with www.domain.com/mysurvey.php
Better?
Frans
Last edit: 10 years 2 months ago by fransmarcelissen.
The following user(s) said Thank You: mrli999
The topic has been locked.
More
10 years 2 months ago #103087 by supercosh
Replied by supercosh on topic shorter url of the survey

mrli999 wrote: And we did can access the survey through: www.domain.com/survey/index.php/789456 , but the address is a little long.


You could also use a URL shortener like bitly.com or write your own redirector, like we do on the commercial LimeSurvey platform dreifragen.net (german). Our URL's then look like this: www.dreifragen.net/u/789456 .

With mod_rewrite and .htaccess, these requests are simply rewritten to the original long url then.

Regards
Gregor
The following user(s) said Thank You: mrli999
The topic has been locked.
  • mrli999
  • mrli999's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
10 years 2 months ago - 10 years 2 months ago #103088 by mrli999
Replied by mrli999 on topic shorter url of the survey

fransmarcelissen wrote: Hi,
If www.domain.com/survey/index.php/789456 is too long, you could create a file like www.domain.com/mysurvey.php (probably /var/www/mysurvey.php), with a redirect as content (
<?php
header('Location: www.domain.com/survey/index.php/789456 ');
?>
Now you can access the survey with www.domain.com/mysurvey.php
Better?
Frans


It is OK. But we have to create a new php file every survey. thanks

I hope to find some solution, so that we can access the survey through:www.domain.com/survey/987456.php
Last edit: 10 years 2 months ago by mrli999.
The topic has been locked.
More
10 years 2 months ago #103089 by supercosh
Replied by supercosh on topic shorter url of the survey
If you are taking into consideration my suggestion with mod_rewrite and .htaccess, you will never have to create a php file ... mod_rewrite recognizes the request /u/123456 and rewrites it automatically to www.example.com/survey/index.php/123456

Also Frans suggestion will need only one file, since the script may take a parameter, you parse it, and simply redirect.

Regards,
Gregor
The following user(s) said Thank You: mrli999
The topic has been locked.
  • fransmarcelissen
  • fransmarcelissen's Avatar
  • Offline
  • Premium Member
  • Premium Member
More
10 years 2 months ago - 10 years 2 months ago #103090 by fransmarcelissen
Replied by fransmarcelissen on topic shorter url of the survey
Something like (untested, I am not a php programmer)
<?php
header('Location: www.domain.com/survey/index.php/'.$_GET ["sid"]);
?>
and www.domain.com/mysurvey.php?sid=123456
Last edit: 10 years 2 months ago by fransmarcelissen.
The following user(s) said Thank You: mrli999
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose