.htaccess 将特定文件转发到子文件夹
我正在清理根目录,里面有很多“垃圾”。
所以我现在正在将所有文件移动到子文件夹“oldroot”中
,我的一些用户正在使用一些垃圾文件....但只有 3-4 个文件....是否有一种简单快捷的方法来配置 . htaccess 仅转发这些特定文件,例如
mypage1.php ==> oldroot/mypage1.php
mypage2.php ==> oldroot/mypage2.php
I am cleaning up my root directory, and it has a lot of "trash" inside.
so i am moving all the files so a subfolder "oldroot"
now, some of my users are using some of the trash files....but only 3-4 files....is there an easy and quick way to configure .htaccess to forward these specific files only, like
mypage1.php ==> oldroot/mypage1.php
mypage2.php ==> oldroot/mypage2.php
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的
.htaccess 文件
中使用:In your
.htaccess file
use:尝试将以下内容添加到站点根目录中的
.htaccess
文件中。它适用于您移动到oldroot 的任何文件,即您想要保留在根目录中的所有文件都将从那里提供服务。
Try adding the following to the
.htaccess
file in the root directory of your site.It will work for any file that you move to
oldroot
i.e. all of the files that you want to leave in the root will be served from there.