shorter url of the survey

More
3 years 9 months ago #103082 by mrli999
mrli999 created the topic: shorter url of the survey
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.

Please Log in to join the conversation.

More
3 years 9 months ago #103083 by supercosh
supercosh replied the 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

Please Log in to join the conversation.

More
3 years 9 months ago #103084 by fransmarcelissen
fransmarcelissen replied the 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

Please Log in to join the conversation.

More
3 years 9 months ago #103085 by mrli999
mrli999 replied the 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.

Please Log in to join the conversation.

More
3 years 9 months ago - 3 years 9 months ago #103086 by fransmarcelissen
fransmarcelissen replied the 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: 3 years 9 months ago by fransmarcelissen.
The following user(s) said Thank You: mrli999

Please Log in to join the conversation.

More
3 years 9 months ago #103087 by supercosh
supercosh replied the 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

Please Log in to join the conversation.

More
3 years 9 months ago - 3 years 9 months ago #103088 by mrli999
mrli999 replied the 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: 3 years 9 months ago by mrli999.

Please Log in to join the conversation.

More
3 years 9 months ago #103089 by supercosh
supercosh replied the 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

Please Log in to join the conversation.

More
3 years 9 months ago - 3 years 9 months ago #103090 by fransmarcelissen
fransmarcelissen replied the 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: 3 years 9 months ago by fransmarcelissen.
The following user(s) said Thank You: mrli999

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now