-2

我最近安装了最新的 LimeSurvey,虽然它有很多我喜欢的功能,但我真的只打算在survey.example.com 子域上提供一项调查。

我想跳过显示“以下调查可用:”的页面,即"survey.example.com/index.php". 并直接进行调查,即"survey.example.com/index.php/311746?lang=en"

我尝试在 .htaccess 中设置 DirectoryIndex 但这没有做任何事情

DirectoryIndex index.php/311746?lang=en

我试过玩 mod_rewrite,但 LimeSurvey 本身已经设置了条件,所以无论我做什么都会破坏他们的(可能是因为他们已经在重写 index.php)。

<IfModule mod_rewrite.c>
RewriteEngine on

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

# otherwise forward it to index.php
RewriteRule . index.php
</IfModule>

我打算尝试重定向,但 index.php 不仅仅是索引,所以我不想改变太多。

我试过四处寻找,但运气不佳。

4

1 回答 1

1

那为什么不改写调查的主要规则。与其将它重写到您不想做的主要 index.php 中,不如将其直接写入您想要的调查中。您应该可以在您的 htaccess 中使用它直接进入调查。

<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 the survey
RewriteRule . index.php/311746?lang=en [R=301,L] 
</IfModule>

让我知道这是否能解决您的问题

于 2015-02-03T18:38:08.617 回答