.htaccess文件具有TIME_MON没有值,time_year阿帕奇瓦尔 [英] .htaccess file has no values for time_mon, time_year apache vars

查看:107
本文介绍了.htaccess文件具有TIME_MON没有值,time_year阿帕奇瓦尔的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图做一些Apache的URL通过的.htaccess重写。我想根据时间和日期来重写。我们希望六月份期间显示特定的图像,并在6月以后显示其他的图像。

I'm trying to do some apache URL rewriting via .htaccess. I want to rewrite based on time and date. We want certain images to be displayed during the month of june, and other images displayed after june.

所以在我的.htaccess文件我有:

So in my .htaccess file I have:

RewriteCond %{TIME_MON} = 05
RewriteRule ^Google_LP.png /img/img/ids/bg.png

但我得到的500错误在网站上了,所以必须在这里是一个错误。当我通过显示的phpinfo()我的Apache ENV瓦尔,我看到有任何apache的时间变量没有价值 - TIME_MON,TIME_YEAR,TIME_MIN等,是不存在的。我确实看到了REQUEST_TIME,但它是一个秒数自纪元。

But I get 500 errors on the site now, so there must be an error here. When I displayed my apache ENV vars via phpinfo(), I see there is no value for any of the apache time variables -- TIME_MON, TIME_YEAR, TIME_MIN, etc, don't exist. I do see a REQUEST_TIME, but it's a number of seconds since the epoch.

会不会有一个原因,没有什么TIME_MON?它是一个Apache的配置?

Would there be a reason there is nothing in TIME_MON? Is it an apache configuration?

推荐答案

有没有在 = 允许的空白和 05 。尝试

There is no white space allowed between = and 05. Try

RewriteCond %{TIME_MON} =05

这篇关于.htaccess文件具有TIME_MON没有值,time_year阿帕奇瓦尔的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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