Apache mod_rewrite删除斜杠是使用文件路径而不是uri写入重定向

Apache mod_rewrite删除斜杠是使用文件路径而不是uri写入重定向,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,不幸的是,我没有直接访问此服务器的权限,因此,通过代理人员进行试错是很困难的 我们有下面的Location指令以及VirtualHost指令中的其他指令。值得注意的是,helloworld是指向其他文件夹的符号链接 <Location /something/helloworld>     Options FollowSymlinks       <IfModule mod_rewrite.c>           <IfModule mod_negotiation.

不幸的是,我没有直接访问此服务器的权限,因此,通过代理人员进行试错是很困难的

我们有下面的Location指令以及VirtualHost指令中的其他指令。值得注意的是,helloworld是指向其他文件夹的符号链接

<Location /something/helloworld>
    Options FollowSymlinks
 
    <IfModule mod_rewrite.c>
 
        <IfModule mod_negotiation.c>
            Options -MultiViews
        </IfModule>
 
        RewriteEngine On
        RewriteBase /something/helloworld/
 
        # Redirect Trailing Slashes...
        RewriteRule ^(.*)/$ $1 [L,R=301] # the $1 seems to be a filepath not a uri
 
        # Handle Front Controller...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
    </IfModule>
</Location>
你知道为什么会这样吗?理想情况下,我希望返回的位置头是

Location: http://www2-dev.example.co.uk/something/helloworld

一如既往,非常感谢您的帮助:-

httpd中有一个奇怪的问题:只有在服务器virtualhost上下文中配置了规则,并且替换中路径的第一个组件存在于可能与您的问题相关的文件系统中时,才将替换视为文件系统路径。您可以尝试:RewriteRule^/?。+?/$/$1吗[NE,L,R=302]然后重新启动Apache。@anubhava不幸的是,该规则没有改变行为,它仍然会重写到文件路径而不是URI。问题似乎与@Ulrichswarz提到的内容有关。因此,如果我将更改为指令,它会单独解决问题。不幸的是,当我们有一个指令时,它也不起作用,这似乎优先于指令。抱歉@anubhava,我按enter键提交了该评论,因此后续评论中出现了其他信息:-/
Location: http://www2-dev.example.co.uk/something/helloworld