调试和测试 mod_rewrite (.htaccess) 指令的工具 [英] A tool to debug and test mod_rewrite (.htaccess) directives

查看:18
本文介绍了调试和测试 mod_rewrite (.htaccess) 指令的工具的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管是一名体面的 Web 开发人员,但我和我的大多数同事在使用 mod_rewrite 时总是为基本任务而苦恼.

Although being a decent web developer, I and most of my colleagues always struggle with basic tasks when using mod_rewrite.

我阅读了手册并理解其中的大部分内容,但是我在生活中学到的大多数技能都是通过实践获得的.问题是,没有简单的方法来调试配置.大多数情况下,如果我成功地配置了 .htaccess 文件,那完全是靠运气,而不是靠反复试验.

I read the manuals and understood most of it, however most skills I've learned in life are by doing. The trouble is, there's no easy way to debug the configuration. Most of the time if I succeed at configuring the .htaccess file it's by sheer random luck not by trial and error.

我意识到可以读取 Apache 错误日志或将 rewriteRule 结果传递给 GET 参数并将它们显示在 PHP 文件中,但这既不方便又慢.

I realize one can read Apache error logs or pass rewriteRule results to GET parameters and present them in say, PHP files, but that's inconvenient and slow.

所以,问题.是否有用于编写和调试 .htaccess 指令的工具? 更新:鉴于要求库和类似的问题经常被关闭,因为超出了 SO 的范围,是否有更多执行此操作的一般技术?

So, the question. Is there a tool for writing and debugging .htaccess directives? Update: given that questions asking for libraries and similar are frequently closed as out of scope for SO, is there a more general technique for doing this?

推荐答案

您可以使用我们的 htaccess tester.它允许您测试基本的重写规则和条件,我们正在尝试随着时间的推移改进它的功能,但它在当前的功能集上做得很好.

You could use our htaccess tester. It allows you to test basic rewrite rules and conditions, we are trying to improve it's functionality over time but it does the job quite well with the current feature set.

这篇关于调试和测试 mod_rewrite (.htaccess) 指令的工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆