Welcome to the LimeSurvey Community Forum

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

hosting limesurvey: subdomain vs subdirectory

  • first
  • first's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
8 years 3 days ago - 8 years 2 days ago #134680 by first
Please advise on hosting LimeSurvey . Should I host it at sub-domain or at sub-directory?

Sub-domain: www.limesurvey.example.com
Sub-directory: www.example.com/limesurvey/

#Best practice
#Things to consider
#Your preference.

Survey Designer and Programmer
Last edit: 8 years 2 days ago by DenisChenu. Reason: Always use example.com/org for example link
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 3 days ago #134684 by holch
I think there is no right or wrong here. It only depends on how you like to organize your server.

On my server I actually use both methods. I have a subdomain for surveys in general, then under that I have different versions of LImesurvey installed in different subfolders. But this makes the URL longer (so i try to keep the subfolder names as short and simple as possible - not more than 2 digits).

But I think this is really up to personal preference.

What you should keep in mind though if you use SSL certificates: The cheaper ones are based on domains. So when you install under a subdomain, you need two of those certificates if you want to use them for your Domain AND your subdomain, if you don't have a wild card certificate (usually more expensive).

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The following user(s) said Thank You: first
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 days ago #134693 by DenisChenu
Replied by DenisChenu on topic hosting limesurvey: subdomain vs subdirectory
Another think: remin of the Iframe :

If you want bto include iframe from limesurvey in you websoite : use sub-directory.

I personnaly prefer sub domain. But same installation can be in a subdomain + sub directory.

Denis
PS : Use example.org/com for example link . I don't bthink your earn money by 1and1.

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.
More
8 years 2 days ago - 8 years 2 days ago #134695 by Ben_V
I personally prefer subdomain use but mainly for the possibility to set a general htaccess for the entire subdomain for SEO & desindexation purposes (maybe GG &co understand better that you refused access to bots for a subdomain rather than a site subsection....but it's not sure)

BTW the 2 approaches are so closed that, for more reversibility, you can perfectly install LS as a subdirectory, set a subdomain pointing to this folder and use a server side rule (htaccess) to redirect example.org/LS to ls.example.org.
Code:
Redirect 301 /LS http://ls.example.org

Another point to consider is the management of SSL certificates... Could be easier if subdirectory.
If someone have some experience about this point, please advise ;)

For whom interested, there is also a third possibility to consider in some cases (e.g. assessment platforms):
Installing LS as the main domain and moving all other content (cms or static files) in a subdirectory.
That's what implemented here with few integration extra work :) where LS is the main CMS even if the site home page redirect to /en/ directory where I reinclude a (dynamic) slightly modified survey list linking to PubMed (only needs small changes in list.php file)

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last edit: 8 years 2 days ago by Ben_V.
The topic has been locked.
More
8 years 2 days ago #134696 by jelo

holch wrote: On my server I actually use both methods.

It might be no longer an issue on LS. But when using subdomain you always have separate cookie sessions, with subdirectory there was one cookie session. You have to set a different cookie/session name in the limesurvey config to separate cookie/session.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The following user(s) said Thank You: Ben_V
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 2 days ago #134699 by holch

jelo wrote: It might be no longer an issue on LS. But when using subdomain you always have separate cookie sessions, with subdirectory there was one cookie session. You have to set a different cookie/session name in the limesurvey config to separate cookie/session.


This is interesting. I never ran into problems here, because usually I would only use one of the installations at a time (one is for production, one is for test, etc.), but who runs two installations for production at the same time, this might be (or might have been) an issue.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
More
7 years 11 months ago - 7 years 11 months ago #134742 by Ben_V

jelo wrote: You have to set a different cookie/session name in the limesurvey config to separate cookie/session.


This reminds me an easily conf doable with subdomains & domains (not tried with subdirectories):
  • Several databases (1 dedicated db for each subdomain)
  • Just 1 install (better for maintenance) setting db credentials condionnals to the subdomain name...
Example for 1 install with 2 subdomains / databases:
Code:
if (strpos($_SERVER['REQUEST_URI'], "subdomain1") !== false){
 
return array(
  'components' => array(
    'db' => array(
      'connectionString' => 'mysql:host=localhost;port=3306;dbname=sd1;',
      'emulatePrepare' => true,
      'username' => 'XXX',
      'password' => '123',
      'charset' => 'utf8',
      'tablePrefix' => 'lime_',
/*
. . . . . . 
. . . . . . 
. . . . . . 
*/
 
 
} else {
 
return array(
  'components' => array(
    'db' => array(
      'connectionString' => 'mysql:host=localhost;port=3306;dbname=db2;',
      'emulatePrepare' => true,
      'username' => 'XXX',
      'password' => '123',
      'charset' => 'utf8',
      'tablePrefix' => 'lime_',
 
/*
. . . . . . 
. . . . . . 
. . . . . . 
*/

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Last edit: 7 years 11 months ago by Ben_V.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago #134795 by DenisChenu
Replied by DenisChenu on topic hosting limesurvey: subdomain vs subdirectory
Remind to update too : upload directory : else files from one survey can be for another survey in another isntallation.

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 following user(s) said Thank You: Ben_V
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose