Forum Moderators: phranque
i do have a directory on my site (containing a dozen of pages) on which i should place a redirect to another page (included into another dir. of my website) for just one day at week.
i'm thinking to solve this with an htaccess rewrite which i will manually upload into this directory every time i need to apply such redirect.
i don't want to make a 301 permanently moved, i don't want SE to consider my content permanently moved, how can i solve this?
Thanks in advance
tito
Use RewriteCond %{TIME_WDAY} to check the day of the week, and if it is the correct day, then rewrite or redirect the requests for the 'usual' subdirectory to the 'special' subdirectory.
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
i have put together this rewrite:
RewriteEngine on
RewriteCond %{TIME_WDAY}%{TIME_HOUR}%{TIME_MIN} >71800
RewriteCond %{TIME_WDAY}%{TIME_HOUR}%{TIME_MIN} <72000
RewriteRule ^directoryA\$ [domain.tld...]
RewriteRule ^directoryB\$ [domain.tld...]
i need to ask you some explanations please:
as i want to allow access to all files included into directoryA on each saturday only (day 7), from 6pm to 8pm, and as the time settings on my server for hour 18.00 is shown as 6.00pm, is it correct to put in the rewrite hours/minutes as 1800?!?
also please, do i have to place this rewrite into the main root or into a separate .htaccess inside directoryA?!?
Thank so much,
tito
The following modified version, placed in your top-level directory, is probably closer to what you want:
RewriteEngine on
RewriteCond %{TIME_WDAY}%{TIME_HOUR}%{TIME_MIN} >61759
RewriteCond %{TIME_WDAY}%{TIME_HOUR}%{TIME_MIN} <62000
RewriteRule ^normal_directory_path/(.*)$ /Saturday_evening_directory_path/$1 [L]
Jim