Welcome, Guest
Username: Password: Remember me

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

Redirect [domain].com to [domain].com/[survey-address] 1 year 7 months ago #92964

  • bdesign
  • bdesign's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 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.
The administrator has disabled public write access.

Redirect [domain].com to [domain].com/[survey-address] 1 year 7 months ago #92969

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6358
  • Thank you received: 824
  • 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]
The administrator has disabled public write access.

Redirect [domain].com to [domain].com/[survey-address] 1 year 7 months ago #92970

  • bdesign
  • bdesign's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 4
  • Karma: 0
Thank you!

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

Thanks again.
The administrator has disabled public write access.

Redirect [domain].com to [domain].com/[survey-address] 1 year 7 months ago #92974

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6358
  • Thank you received: 824
  • 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>
The administrator has disabled public write access.

Redirect [domain].com to [domain].com/[survey-address] 1 year 7 months ago #92975

  • bdesign
  • bdesign's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 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.
Last Edit: 1 year 7 months ago by bdesign. Reason: code
The administrator has disabled public write access.

Redirect [domain].com to [domain].com/[survey-address] 1 year 7 months ago #92977

  • Ben_V
  • Ben_V's Avatar
  • OFFLINE
  • Platinum Lime
  • Posts: 1098
  • Thank you received: 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...
Last Edit: 1 year 7 months ago by Ben_V.
The administrator has disabled public write access.

Redirect [domain].com to [domain].com/[survey-address] 1 year 7 months ago #93054

  • helper
  • helper's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 126
  • Thank you received: 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.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.261 seconds
Donation Image