从目录重定向到子目录

时间:2017-03-22 14:46:09

标签: .htaccess

我有一个带有followinf结构的网络服务器: 万维网 --- diceroller ------网络

我想将传入/ diceroller的任何请求重定向到/ diceroller / web,因此用户无需在URL中键入/ web。

在我的服务器的根目录是一个包含以下元素的.htaccess:

Options +FollowSymLinks
RewriteEngine On
RewriteRule ^diceroller/(.*)$ /diceroller/web/$1 [R=301,NC,L]

我尝试使用以下.htaccess放置在diceroller forlder中,但我点击了403:

 Imgproc.cvtColor(mRgba, mGray, Imgproc.COLOR_RGBA2GRAY);

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

RewriteRule的模式是相对于当前目录的。因此,如果您的htaccess位于/ diceroller中,您必须从模式中删除它,请尝试以下代码

RewriteRule ^((?!web).*)$ /diceroller/web/$1 [L,R]
相关问题