0

我正在尝试为我在服务器中托管的几个调查提供更好的 URL。

所以这就是我所做的。

  • 在服务器的 /var/www 目录中(与 index.php 文件所在的位置相同),我创建了一个文件 .htaccess。
  • 以下是 .htaccess 文件的内容:

    RewriteEngine On
    RewriteRule goodURL BadURL
    Redirect goodURL BadURL
    

请注意 goodURL (midnightsun.hiit.fi/socialnetworking) 是不存在的,而 BadURL(midnightsun.hiit.fi/limesurvey/index.php/755819) 是存在的。

我想更改此 URL 重定向的原因是提供良好的 URL。

Debian GNU/Linux 7.6 (wheezy) 是服务器上的操作系统。它是 Apache2。

谁能帮我这个?

4

1 回答 1

0
Redirect temp /liliurl http://example.org/index.php/755819

<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>
# General setting to properly handle LimeSurvey paths
# AcceptPathInfo on
于 2014-10-18T09:30:14.950 回答