Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache URL重定向无法使用。htaccess无法使用_Apache_.htaccess_Mod Rewrite_Redirect_Limesurvey - Fatal编程技术网

Apache URL重定向无法使用。htaccess无法使用

Apache URL重定向无法使用。htaccess无法使用,apache,.htaccess,mod-rewrite,redirect,limesurvey,Apache,.htaccess,Mod Rewrite,Redirect,Limesurvey,我试图为我在服务器上主持的两个调查提供更好的URL 这就是我所做的 在服务器的/var/www目录中(与index.php文件所在的位置相同),我创建了一个文件.htaccess 以下是.htaccess文件的内容: RewriteEngine On RewriteRule goodURL BadURL Redirect goodURL BadURL 请注意,goodURL(midnightsun.hiit.fi/socialnetworking)是不存在的,而as BadURL(mid

我试图为我在服务器上主持的两个调查提供更好的URL

这就是我所做的

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

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

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

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

有人能帮我吗?

重定向temp/urlhttp://example.org/index.php/755819
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
重新启动发动机 #如果存在目录或文件,请直接使用它 重写cond%{REQUEST_FILENAME}-F #否则将其转发到index.php 重写规则。index.php #正确处理石灰测量路径的常规设置 #上的AcceptPathInfo
使用其中一项,但不要同时使用两项:1)
重定向/社交网络https://midnightsun.hiit.fi/limesurvey/index.php/755819
或2)
重写规则^socialnetworking$limesurvey/index.php/755819
也许你的工具已经有了一个htaccess文件(limesurvey从很多年以来就有了一个…)。重定向(在现有规则之前)是最好的方法。@DenisChenu。谢谢你的参与。你能帮帮我吗,它应该是什么样子?现在好像