Welcome to the LimeSurvey Community Forum

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

What determines the LimeSurvey route type?

  • mhladun
  • mhladun's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 months 4 days ago - 8 months 4 days ago #245974 by mhladun
Your LimeSurvey version: 5.6.33
Our own server: CentOS / Apache 2.4 / PostgreSQL 
Survey theme/template: Custom
==================
I've noticed code snippets across this forum and in the LimeSurvey manual using routes like index.php/admin/remotecontrol and index.php?r=admin/remotecontrolWhat determines if an instance uses "slash endpoints" or "query string" endpoints?
Last edit: 8 months 4 days ago by mhladun.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 months 3 days ago #246004 by holch
Replied by holch on topic What determines the LimeSurvey route type?
Both are valid. If your webserver supports it, the URL can be rewritten to something that looks nicer (index.php/admin/remotecontrol), but index.php?r=admin/remotecontrol is perfectly fine.

For the first URL to work I think your webserver must support mod_rewrite, I think.

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

Please Log in to join the conversation.

  • mhladun
  • mhladun's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 months 2 weeks ago - 7 months 2 weeks ago #250099 by mhladun
Replied by mhladun on topic What determines the LimeSurvey route type?
If LimeSurvey supports both, why would the site not return the API docs view when I visit "index.php/admin/remotecontrol"?

When I visit "index.php?r=admin/remotecontrol", I get a list of API methods.

When I visit "index.php/admin/remotecontrol", I am taken to our LimeSurvey instance's homepage.

Our Apache configuration does not check for endpoint types and then redirect traffic based off that. Whatever endpoint I visit should be the endpoint that LimeSurvey/PHP uses to determine what view is rendered, right?
Code:
<VirtualHost *:80>
   ServerName DOMAIN
   DocumentRoot /var/www/html/limesurvey
   # force https
   RewriteEngine On
   RewriteCond %{HTTPS} off
   RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</VirtualHost>
<VirtualHost *:443>
   ServerName DOMAIN
   DocumentRoot /var/www/html/limesurvey
  <Directory "/var/www/html/limesurvey">
      DirectoryIndex index.php index.html
      Options FollowSymLinks
      AllowOverride All
      Require all granted
   </Directory>
</VirtualHost>


What else could be causing "index.php/admin/remotecontrol" not to work?

It's not just "index.php/admin/remotecontrol", by the way. Any "slash endpoints" do not work, only "query string" endpoints do.
Last edit: 7 months 2 weeks ago by mhladun.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 months 2 weeks ago #250105 by holch
Replied by holch on topic What determines the LimeSurvey route type?

When I visit "index.php/admin/remotecontrol", I am taken to our LimeSurvey instance's homepage.


This, to me sounds like mod_rewrite is not working well for your installation.

Where is Limesurvey installed? With its own domain / subdomain, or as a subfolder of your website where there is another software like Wordpress or any CMS running?

Sometimes different .htaccess files can cause issues.

Also, how do you access your LS administration? How does the URL look like? (don't need to see the domain, etc., but rather the URL part after that.

E.g. subdomain.domain.tld/xyz/index.php/admin...hentication/sa/login

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

Please Log in to join the conversation.

  • mhladun
  • mhladun's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 months 2 weeks ago - 7 months 2 weeks ago #250114 by mhladun
Replied by mhladun on topic What determines the LimeSurvey route type?
I should mention that, when I say

When I visit "index.php/admin/remotecontrol", I am taken to our LimeSurvey instance's homepage.

The URL remains subdomain.domain/index.php/admin/remotecontrol , and it isn't changed to anything else.

Our LS instance has it's own subdomain.

To access the admin portal, we visit "subdomain.domain.ca/index.php?r=admin/authentication/sa/login".

"subdomain.domain.ca/index.php/admin/authentication/sa/login" leads to our LS homepage, with the URL remaining unchanged (no browser redirect).

I can investigate .htaccess files, but all the ones I've come across are simply "Deny from all".
Last edit: 7 months 2 weeks ago by mhladun.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 months 2 weeks ago #250116 by holch
Replied by holch on topic What determines the LimeSurvey route type?

To access the admin portal, we visit "subdomain.domain.ca/index.php?r=admin/authentication/sa/login".

"subdomain.domain.ca/index.php/admin/authentication/sa/login" leads to our LS homepage, with the URL remaining unchanged (no browser redirect).


This sounds to me like your webserver is not configured for mod_redirect. So I am not surprised that index.php/admin/remotecontrol doesn't work then. Because it is just index.php?r=admin/remotecontrol made "nicer" via mod_rewrite.

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

Please Log in to join the conversation.

  • mhladun
  • mhladun's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 months 2 weeks ago #250117 by mhladun
Replied by mhladun on topic What determines the LimeSurvey route type?
mod_redirect isn't an existing module, maybe you mean mod_alias?

If LimeSurvey supports both formats, and I want users to be able to use either formats, I should be able to leave my Apache config the way it is, no? I haven't come across any other LS Apache configs that do any special rewrites to support endpoint types.

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 months 2 weeks ago #250120 by holch
Replied by holch on topic What determines the LimeSurvey route type?
Never mentioned "mod_redirect", but "mod_rewrite":

httpd.apache.org/docs/current/mod/mod_rewrite.html

And yes, Limesurvey supports both formats, but I don't think at the same time. If mod_rewrite is own and you visit "subdomain.domain.ca/index.php?r=admin/authentication/sa/login" afaik it will always turn into "subdomain.domain.ca/index.php/admin/authentication/sa/login"

But I am not an expert on server configuration.

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

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose