Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
.htaccess htaccess重写URL的规则重定向';没有尾随斜线的斜线_.htaccess - Fatal编程技术网

.htaccess htaccess重写URL的规则重定向';没有尾随斜线的斜线

.htaccess htaccess重写URL的规则重定向';没有尾随斜线的斜线,.htaccess,.htaccess,我在.htaccess文件中有此代码片段,用于防御任何试图进入应用程序目录的人 RewriteCond %{REQUEST_URI} ^/app.*$ RewriteRule ^(.*[^/])/?$ index.php?r=$1 [L,QSA] 尽管当我进入http://domain/app/,如果我向http://domain/app,它将重定向到http://domain/app/?r=app 有人知道需要更改什么来停止这种重定向吗?尝试使用 [L] 而不是 [L,QSA] 尝试可在

我在
.htaccess
文件中有此代码片段,用于防御任何试图进入应用程序目录的人

RewriteCond %{REQUEST_URI} ^/app.*$
RewriteRule ^(.*[^/])/?$ index.php?r=$1 [L,QSA]
尽管当我进入
http://domain/app/
,如果我向
http://domain/app
,它将重定向到
http://domain/app/?r=app

有人知道需要更改什么来停止这种重定向吗?

尝试使用

[L]
而不是

[L,QSA]

尝试可在全局或每个目录中使用的
directorysslash
指令

RewriteCond %{REQUEST_URI} ^/app.*$
RewriteRule ^(.*[^/])/?$ index.php?r=$1 [L,QSA]

哇。。。六个月太晚了。没有看到。。。对不起,没关系,谢谢你的注意和回答:)我已经放弃了这条路,选择了另一条路,但现在我可能会回来