Bienvenue, Invité
Nom d'utilisateur : Mot de passe : Se souvenir de moi

SUJET : Redirect [domain].com to [domain].com/[survey-address]

Redirect [domain].com to [domain].com/[survey-address] il y a 1 an 7 mois #92964

  • bdesign
  • Portrait de bdesign
  • Hors ligne
  • Fresh Lemon
  • Messages : 4
  • Karma: 0
Hi,

I'm using LimeSurvey v2.0

I've changed my .htaccess file to read:

<IfModule mod_rewrite.c>
RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . http://[domain-name].com/index.php/survey/index/sid/383338/newtest/Y/lang/en
</IfModule>

I've done this so people visiting the domain are directed to the survey without any hassle.

This causes [domain-name].com/admin/ to redirect to said survey. I have to enter [domain-name].com/admin/index.php to access the back end.

Is there any way I can redirect visitors to the survey in a cleaner way? I envision this might cause errors I would prefer to avoid.

Thank you.
L'administrateur a désactivé l'accès en écriture pour le public.

Redirect [domain].com to [domain].com/[survey-address] il y a 1 an 7 mois #92969

  • DenisChenu
  • Portrait de DenisChenu
  • Hors ligne
  • Moderator Lime
  • Messages : 6362
  • Remerciements reçus 827
  • Karma: 245
You just want to have default home page to a specific survey.

Then:
RewriteRule ^$ /index.php/survey/index/sid/383338/newtest/Y/lang/en [R=temp,L]
L'administrateur a désactivé l'accès en écriture pour le public.

Redirect [domain].com to [domain].com/[survey-address] il y a 1 an 7 mois #92970

  • bdesign
  • Portrait de bdesign
  • Hors ligne
  • Fresh Lemon
  • Messages : 4
  • Karma: 0
Thank you!

I knew it was a noob question. It had to do with .htaccess more than LimeSurvey. :pinch:

Thanks again.
L'administrateur a désactivé l'accès en écriture pour le public.

Redirect [domain].com to [domain].com/[survey-address] il y a 1 an 7 mois #92974

  • DenisChenu
  • Portrait de DenisChenu
  • Hors ligne
  • Moderator Lime
  • Messages : 6362
  • Remerciements reçus 827
  • Karma: 245
Complete htaccess for LS:
<IfModule mod_rewrite.c>
    RewriteEngine on
 
    RewriteRule ^$ /index.php/383338 [R=temp,L]
 
 
    # if a directory or a file exists, use it directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
 
    # otherwise forward it to index.php
    RewriteRule . index.php
</IfModule>
L'administrateur a désactivé l'accès en écriture pour le public.

Redirect [domain].com to [domain].com/[survey-address] il y a 1 an 7 mois #92975

  • bdesign
  • Portrait de bdesign
  • Hors ligne
  • Fresh Lemon
  • Messages : 4
  • Karma: 0
Thanks!

First I tried:
DirectoryIndex http://[domain].com/index.php/survey/index/sid/383338/newtest/Y/lang/en
RewriteEngine on
RewriteRule ^$ /index.php/survey/index/sid/383338/newtest/Y/lang/en [R=temp,L]

Which sort of worked. But your updated version is a lot more practical.
Dernière édition: il y a 1 an 7 mois par bdesign. Raison: code
L'administrateur a désactivé l'accès en écriture pour le public.

Redirect [domain].com to [domain].com/[survey-address] il y a 1 an 7 mois #92977

  • Ben_V
  • Portrait de Ben_V
  • Hors ligne
  • Platinum Lime
  • Messages : 1098
  • Remerciements reçus 247
  • Karma: 78
Maybe just set a redirection to your survey (using javascript or meta refresh tag) into the surveylist.pstpl file of you default template (template used by your platform root url; can be different than your survey template ).

I don't know if it's exactly what needed, but try it (disable htaccess for testing).
Benoît

goo.gl/Bw5iM => Recherche GG dans le forum français (remplacer "exemple" dans la barre de recherche)
goo.gl/WX8PH => GG search for english forum (Replace "example" in the search bar)
goo.gl/IxiGu => Búsqueda en el foro en español (Cambiar "ejemplo" en la barra de...
Dernière édition: il y a 1 an 7 mois par Ben_V.
L'administrateur a désactivé l'accès en écriture pour le public.

Redirect [domain].com to [domain].com/[survey-address] il y a 1 an 7 mois #93054

  • helper
  • Portrait de helper
  • Hors ligne
  • Expert Lime
  • Messages : 126
  • Remerciements reçus 18
  • Karma: 0
Forgive me if I misunderstand, but what bdesgin may be looking for is a "short URL" - this can be accomplished in the Apache httpd.conf (put at the end or put in your virtuals file) something like this:
Redirect /shortURL /index.php/167493?lang=en

This will redirect anybody that comes in on http://[domain]/shortURL to the default survey. Note that you can use multiples here if you have more than one survey.
L'administrateur a désactivé l'accès en écriture pour le public.
Modérateurs: ITEd
Temps de génération de la page : 0.349 secondes
Donation Image