你必须重新启动Apache以使在的.htaccess重写规则生效? [英] Do you have to restart apache to make re-write rules in the .htaccess take effect?

查看:908
本文介绍了你必须重新启动Apache以使在的.htaccess重写规则生效?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经把我的.htaccess文件到生产西弗斯,但他们没有工作。将重新启动成为下一步,或者我应该检查别的东西。

解决方案

一个重启的不可以需要修改为.htaccess。别的东西是错误的。

请确保你的.htaccess包含语句

  

RewriteEngine叙述

这是必需的,即使它也是美元的httpd.conf中p $ psent。同时检查的.htaccess是httpd进程可读。
检查的error_log - 它会告诉任何错误,在.htaccess你的如果的它的使用。 在.htaccess把有意语法错误是一个很好的检查,以确保正在使用的文件 - 你应该得到一个500错误的任何页面上,在同一个目录

最后,您可以使用命令就像在你的httpd.conf以下启用重写日志

  

RewriteLog日志/ rewritelog

     

RewriteLogLevel 7

由此产生的日志文件会给你血淋淋的细节,其中重写规则匹配,以及它们如何被处理的。

I have pushed my .htaccess files to the production severs, but they don't work. Would a restart be the next step, or should I check something else.

解决方案

A restart is not required for changes to .htaccess. Something else is wrong.

Make sure your .htaccess includes the statement

RewriteEngine on

which is required even if it's also present in httpd.conf. Also check that .htaccess is readable by the httpd process.
Check the error_log - it will tell you of any errors in .htaccess if it's being used. Putting an intentional syntax error in .htaccess is a good check to make sure the file is being used -- you should get a 500 error on any page in the same directory.

Lastly, you can enable a rewrite log using commands like the following in your httpd.conf:

RewriteLog "logs/rewritelog"

RewriteLogLevel 7

The log file thus generated will give you the gory detail of which rewrite rules matched and how they were handled.

这篇关于你必须重新启动Apache以使在的.htaccess重写规则生效?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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