验证是否.htaccess文件运行 [英] Verify if .htaccess file is running

查看:308
本文介绍了验证是否.htaccess文件运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我怎么能验证是否的.htaccess 文件正在运行?我可以写的回声这是工作的消息,如果我不写的话,哪里会那行呼应了呢?

Hello how can I verify if the .htaccess file is running? Can I write an echo "it is working" message, if I do write it, where would that line be echoed out?

的.htaccess 第一个文件夹中加载还是要加载的最后一个文件?

Is .htaccess the first file to be loaded in the folder or is it the last file to be loaded?

推荐答案

输入一些垃圾的价值到您的的.htaccess 并访问您的网址。如果这是工作,你应该得到一个

Enter some junk value into your .htaccess and visit your URL. If it is working, you should get a

500内部服务器错误

500 Internal Server Error

服务器遇到一个内部错误或配置错误,无法完成您的请求......

The server encountered an internal error or misconfiguration and was unable to complete your request....

我建议你以后 RewriteEngine叙述把它很快就

既然你是你的机器上。我presume您可以访问到Apache .conf文件文件。

Since you are on your machine. I presume you have access to apache .conf file.

打开 .conf文件文件,查找类似的一行:

open the .conf file, and look for a line similar to:

LoadModule rewrite_module modules/mod_rewrite.so

如果它被注释掉(#),取消并重新启动Apache的。

If it is commented(#), uncomment and restart apache.

要登录重写

RewriteEngine On
RewriteLog "/path/to/rewrite.log"
RewriteLogLevel 9

把上面的3条线路在虚拟主机。重新启动httpd的。

Put the above 3 lines in your virtualhost. restart the httpd.

RewriteLogLevel 9 使用的级别高值将Apache服务器急剧减速!使用重写日志文件在一个水平高于2只用于调试! 9级将记录几乎所有rewritelog细节。

RewriteLogLevel 9 Using a high value for Level will slow down your Apache server dramatically! Use the rewriting logfile at a Level greater than 2 only for debugging! Level 9 will log almost every rewritelog detail.

事情已经在Apache的2.4改为:

Things have changed in Apache 2.4:

这是从2.2 升级到2.4

FROM Upgrading to 2.4 from 2.2

RewriteLog RewriteLogLevel 指令已被删除。此功能现在通过使用的LogLevel 指令配置日志的适当水平mod_rewrite的模块提供。又见mod_rewrite的记录部分。

The RewriteLog and RewriteLogLevel directives have been removed. This functionality is now provided by configuring the appropriate level of logging for the mod_rewrite module using the LogLevel directive. See also the mod_rewrite logging section.

有关更多的LogLevel,请参阅 LogLevel指令

For more on LogLevel, refer LogLevel Directive

您可以完成

RewriteLog "/path/to/rewrite.log"

现在以这种方式

LogLevel debug rewrite_module:debug

这篇关于验证是否.htaccess文件运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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