Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 设置一周中特定日期的htaccess重写_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Apache 设置一周中特定日期的htaccess重写

Apache 设置一周中特定日期的htaccess重写,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我以前用过这个,但现在好像不起作用了 我试图在星期五和星期六之间重定向到我的htaccess文件中的URL 目前,我所拥有的是: RewriteCond %{REQUEST_URI} ^/page/ RewriteCond %{TIME_WDAY} >4 RewriteCond %{TIME_WDAY} <0 RewriteRule ^(.*)$ http://%{HTTP_HOST}/other-page/$1 [NC,L] RewriteCond%{REQUEST_URI}^/

我以前用过这个,但现在好像不起作用了

我试图在星期五和星期六之间重定向到我的
htaccess
文件中的URL

目前,我所拥有的是:

RewriteCond %{REQUEST_URI} ^/page/
RewriteCond %{TIME_WDAY} >4
RewriteCond %{TIME_WDAY} <0
RewriteRule ^(.*)$ http://%{HTTP_HOST}/other-page/$1 [NC,L]
RewriteCond%{REQUEST_URI}^/页/
重写cond%{TIME_WDAY}>4

RewriteCond%{TIME\u WDAY}
%{TIME\u WDAY}
变量表示从0到6的星期几。因此,如果您想在您的条件下匹配
friday
,那么
RewriteCond
将看起来像
RewriteCond%{TIME\u WDAY}=5

要仅在
星期五
星期六
重定向站点,您需要使用两个条件,并使用
[或]
条件标志组合它们

RewriteCond %{REQUEST_URI} ^/page/
RewriteCond %{TIME_WDAY} =5 [OR]
RewriteCond %{TIME_WDAY} =6
RewriteRule ^(.*)$ http://%{HTTP_HOST}/other-page/$1 [NC,L]
也可以使用单个条件

 RewriteCond %{TIME_WDAY} >4
这将检查
%{TIME\u WDAY}
是否大于
4

在这种情况下,它匹配5和6。

%{TIME\u WDAY}
变量表示从0到6的一周中的某一天。因此,如果您想在您的条件下匹配
friday
,那么
RewriteCond
将看起来像
RewriteCond%{TIME\u WDAY}=5

要仅在
星期五
星期六
重定向站点,您需要使用两个条件,并使用
[或]
条件标志组合它们

RewriteCond %{REQUEST_URI} ^/page/
RewriteCond %{TIME_WDAY} =5 [OR]
RewriteCond %{TIME_WDAY} =6
RewriteRule ^(.*)$ http://%{HTTP_HOST}/other-page/$1 [NC,L]
也可以使用单个条件

 RewriteCond %{TIME_WDAY} >4
这将检查
%{TIME\u WDAY}
是否大于
4

在这种情况下,这与5和6匹配。

Ok cool。谢谢现在这更有意义了。我将使用OR条件标志组合它们。再次感谢!好的,很酷。谢谢现在这更有意义了。我将使用OR条件标志组合它们。再次感谢!