具有不同重写规则的多个 htaccess 文件
我有 2 个 .htaccess 文件 - 一个在根目录中,另一个在子目录中:
相应的 docroot/ 和 /subdirectory/docroot (这个文件就像一个单独的帐户)。
问题是两个文件中有不同的重写规则。基本上,问题是子目录中的 .htaccess 不起作用和/或被忽略。
我想要实现的是为文档根设置一组重写规则,为子目录/文档根
编辑设置另一组重写规则: subdirectory/docroot 中的 .htaccess 文件基本上从 url 中剥离了 index.php,它实际上有效,但是当我转到 subdirectory/user 时,它会重定向到 subdirectory/user/login (而不是 subdirectory/index.php/user/login - - 这部分没问题)但网站显示根页面(不是子目录,而是域根)
有什么想法吗?
I have 2 .htaccess files - one in root directory, another in subdirectory:
accordingly docroot/ and /subdirectory/docroot (this one works like a separate account).
The problem is that there are different rewrite rules in both files. Basicly, the problem is that the .htaccess in subdirectory doesn't work and/or is ignored.
What I am trying to achieve is to have one set of rewrite rules for docroot and other set of rewrite rules for subdirectory/docroot
edit:
the .htaccess file in subdirectory/docroot basicly strips index.php from url, and it actually works, but when i go to subdirectory/user it redirects to subdirectory/user/login (instead of subdirectory/index.php/user/login -- this parts is ok) but the website shows the root page (not subdirectory, but domain root)
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我只需将 RewriteBase 设置为该特定子目录即可使事情正常进行。
I just had to set RewriteBase to that particular subdirectory to make things work.