htaccess 仅在根文件夹中
我一直在寻找答案,但没有找到。我在根文件中有 .htaccess,它将 /loremipsum/ 重定向到 index.php?url=loremipsum,但是,它也想在子目录中工作。我有很多这样的文件,因此将 .htaccess 文件放入每个人中会很痛苦。有什么办法让它只在根文件夹中工作吗?
I was looking for an answer, but didn't find it. I have .htaccess in root file which redirect /loremipsum/ to index.php?url=loremipsum, but, it also wants to work in subdirectories. I have a lot of them, so putting .htaccess file in everyone would be painful. Is there any way to make it working only in root folder?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果添加此规则,它将仅适用于不存在的文件和文件夹
if you add this rules it will only work on files and folders that didnt exist
要使您的重定向规则仅在根目录中工作,请使用以下基于否定lokahead的代码:
To make your redirect rule work only in root dir use this negative lokahead based code: