流行的技术调试的.htaccess [英] Popular techniques to debug .htaccess

查看:203
本文介绍了流行的技术调试的.htaccess的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一个自学成才的codeR和我喜欢呼应可疑变量和注释掉code调试。

I'm a self-taught coder and I like to debug by echoing suspicious variables and commenting out code.

最近,我不得不学习更多关于.htaccess文件。我需要它做的事情一样跨preT PHP脚本PHP5的,URL重写,限制上传文件大小等....我有很多的麻烦调试.htaccess文件。我经常要迁移的PHP应用程序从一个共享宿主环境而异。有时,这打破了.htaccess文件(或者相反,在东西.htaccess文件打破了网站)。我检查,以确保域名被更新。

Lately, I've had to learn more about the .htaccess file. I need it to do things like interpret php scripts as php5, url rewriting, limit file upload size etc.... I have a lot of trouble debugging a .htaccess file. I often have to migrate PHP applications from one shared hosting environment to another. Sometimes this breaks the .htaccess file (or instead, something in the .htaccess file breaks the site). I check to make sure domain names are updated.

有没有流行的技术调试.htaccess文件?难道仅仅是看在Apache日志?还有别的吗?

Are there popular techniques for debugging a .htaccess file? Is it just look in the apache logs? Anything else?

推荐答案

展望在Apache日志是调试的.htaccess恕我直言(加rewriteLog指令如有必要),最简单的方法

Looking in the apache logs is the easiest way to debug .htaccess imho (adding rewriteLog Directive if necessary)

有关迁移:如果您使用的不是里面的.htaccess任何物理文件路径(即/var/www/site/script.php),他们应工作没有问题。如果不是这种情况,请首先尝试删除所有的选项,只留下重定向指令,在这种模式下,你可以看到,如果它的问题,它否认重写默认设置的服务器配置。

About migrating: if you are not using any physical file paths inside .htaccess (i.e. /var/www/site/script.php) they should be working without problems. If this is not the case, first try to remove all options and leave only redirect directives, in this mode you can see if it's problem with server configuration which denies rewriting of default settings.

一些参考

这篇关于流行的技术调试的.htaccess的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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