RewriteRule从子文件夹路径到另一个子文件夹路径
我目前正在为将网站迁移到新平台的客户创建一堆 RewriteRules,并且遇到以下规则的奇怪问题:
RewriteRule ^/folder/filename.cfm /another_folder/subfolder/filename.cfm?name=value
我从来没有遇到过规则右侧的问题,顺便说一句,URL 确实有效。但左边是我第一个带文件夹的。
所以发生的事情是我收到 404 错误。但下面的规则就可以正常工作。
RewriteRule ^filename.cfm /another_folder/subfolder/filename.cfm?name=value
任何人都有任何想法。顺便说一句,如果这是在 Windows 系统上使用 Helicon Ape Manager 的话。
I'm currently creating a bunch for RewriteRules for a customer migrating their website to a new platform and having a weird issue with the following rule:
RewriteRule ^/folder/filename.cfm /another_folder/subfolder/filename.cfm?name=value
I've never had problems with the right side of the rule, which BTW the URL does work. But the left side is my first with a folder.
So what happens is I get as a 404 error. But the following rule will work just fine.
RewriteRule ^filename.cfm /another_folder/subfolder/filename.cfm?name=value
Anyone have any ideas. BTW, were this is on a Windows system using Helicon Ape Manager.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我猜您正在 /folder/ 内使用 .htaccess 文件?以下是 Helicon Ape 文档 上下文和处理顺序 的引用:
I guess you are using .htaccess file inside /folder/? Here is quote from Helicon Ape documentation Context and processing order :
我在使用 HTTP 请求嗅探器后发现的问题是 APE 会将重定向链接标准化。因此,包含
%2E
的链接将转义为%372E
。因此链接变得无效。The issue I discovered after using an HTTP request sniffer is that APE will normalize the redirecting links. So a link that includes
%2E
will get escaped to%372E
. And so the links were becoming invalid.