Knowledge Base

Get Expert Website Hosting

Choose website reliability and expertise with SiteGround!

Home / Website Help / Other / How to make a rewrite rule time-dependent?

How to make a rewrite rule time-dependent?

Last update: Feb 06, 2020

To make a .htaccess rewrite rule time-dependent, add the following line before the rewrite rule you wish to make time-dependent:

RewriteCond %{TIME_HOUR} ^09

This way the rewrite rule following the condition will be executed after 9 AM.

If you wish to use minutes in the condition, you should add:

RewriteCond %{TIME_HOUR}%{TIME_MIN} ^0923

This way the rewrite rule following the condition will be executed after 9:23 AM.

Share this article